home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 10 / develop Issue 10 code / Apple Event Objects.sea / Apple Event Objects / cWindow.c < prev    next >
MacBinary  |  1992-04-08  |  20.6 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Apr 8 17:58:51 1992, modified Wed Apr 8 17:58:51 1992, creator Think C, type ASCII, 20093 bytes "cWindow.c" , at 0x4efd 802 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 63 57 69 6e 64 6f | 77 2e 63 00 00 00 00 00 |..cWindo|w.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 4e 7d 00 | 00 03 22 a6 09 1d 1b a6 |.....N}.|..".....|
|00000060| 09 1d 1b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 9e 82 00 00 |........|........|
|00000080| 0d 0d 2f 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a |../* * *| * * * *|
|00000090| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000000a0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000000b0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000000c0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000000d0| 20 2a 20 2a 20 2a 2f 0d | 2f 2a 09 09 09 09 09 09 | * * */.|/*......|
|000000e0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 20 20 |........|...... |
|000000f0| 20 2a 2f 0d 2f 2a 09 54 | 68 69 73 20 66 69 6c 65 | */./*.T|his file|
|00000100| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 63 6f | contain|s the co|
|00000110| 64 65 20 66 6f 72 20 69 | 6d 70 6c 65 6d 65 6e 74 |de for i|mplement|
|00000120| 69 6e 67 20 74 68 65 20 | 63 57 69 6e 64 6f 77 20 |ing the |cWindow |
|00000130| 41 45 20 6f 62 6a 65 63 | 74 2e 09 09 20 09 20 20 |AE objec|t... . |
|00000140| 20 2a 2f 0d 2f 2a 09 09 | 09 09 09 09 09 09 09 09 | */./*..|........|
|00000150| 09 09 09 09 09 09 09 09 | 09 09 20 20 20 2a 2f 0d |........|.. */.|
|00000160| 2f 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a |/* * * *| * * * *|
|00000170| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00000180| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00000190| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000001a0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000001b0| 20 2a 20 2a 2f 0d 0d 2f | 2a 20 49 6e 63 6c 75 64 | * */../|* Includ|
|000001c0| 65 20 61 6e 79 20 63 6f | 6e 74 61 69 6e 65 72 20 |e any co|ntainer |
|000001d0| 6f 72 20 70 61 72 65 6e | 74 20 63 6c 61 73 73 20 |or paren|t class |
|000001e0| 68 65 61 64 65 72 73 20 | 68 65 72 65 20 2a 2f 0d |headers |here */.|
|000001f0| 23 69 6e 63 6c 75 64 65 | 20 22 41 45 50 61 63 6b |#include| "AEPack|
|00000200| 4f 62 6a 65 63 74 2e 68 | 22 0d 23 69 6e 63 6c 75 |Object.h|".#inclu|
|00000210| 64 65 20 22 41 45 4f 62 | 6a 65 63 74 73 2e 68 22 |de "AEOb|jects.h"|
|00000220| 0d 23 69 6e 63 6c 75 64 | 65 20 22 41 45 52 65 67 |.#includ|e "AEReg|
|00000230| 69 73 74 72 79 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |istry.h"|.#includ|
|00000240| 65 20 3c 70 61 63 6b 61 | 67 65 73 2e 68 3e 0d 23 |e <packa|ges.h>.#|
|00000250| 69 6e 63 6c 75 64 65 20 | 22 53 63 72 69 70 74 53 |include |"ScriptS|
|00000260| 63 72 61 70 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |crap.h".|#include|
|00000270| 20 22 50 72 6f 74 6f 74 | 79 70 65 73 2e 68 22 0d | "Protot|ypes.h".|
|00000280| 0d 0d 0d 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |...pasca|l OSErr |
|00000290| 57 69 6e 64 6f 77 46 72 | 6f 6d 4e 75 6c 6c 41 63 |WindowFr|omNullAc|
|000002a0| 63 65 73 73 6f 72 20 28 | 20 44 65 73 63 54 79 70 |cessor (| DescTyp|
|000002b0| 65 20 64 65 73 69 72 65 | 64 43 6c 61 73 73 2c 0d |e desire|dClass,.|
|000002c0| 09 09 09 63 6f 6e 73 74 | 20 41 45 44 65 73 63 20 |...const| AEDesc |
|000002d0| 2a 63 6f 6e 74 61 69 6e | 65 72 2c 20 44 65 73 63 |*contain|er, Desc|
|000002e0| 54 79 70 65 20 63 6f 6e | 74 61 69 6e 65 72 43 6c |Type con|tainerCl|
|000002f0| 61 73 73 2c 20 44 65 73 | 63 54 79 70 65 20 6b 65 |ass, Des|cType ke|
|00000300| 79 46 6f 72 6d 2c 0d 09 | 09 09 63 6f 6e 73 74 20 |yForm,..|..const |
|00000310| 41 45 44 65 73 63 20 2a | 6b 65 79 44 61 74 61 2c |AEDesc *|keyData,|
|00000320| 20 41 45 44 65 73 63 20 | 2a 72 65 74 75 72 6e 65 | AEDesc |*returne|
|00000330| 64 54 6f 6b 65 6e 2c 20 | 6c 6f 6e 67 20 72 65 66 |dToken, |long ref|
|00000340| 43 6f 6e 20 29 0d 7b 0d | 09 57 69 6e 64 6f 77 50 |Con ).{.|.WindowP|
|00000350| 74 72 09 63 75 72 72 57 | 69 6e 64 6f 77 20 3d 20 |tr.currW|indow = |
|00000360| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 3b 0d 09 |FrontWin|dow();..|
|00000370| 6c 6f 6e 67 09 09 63 6f | 75 6e 74 20 3d 20 31 3b |long..co|unt = 1;|
|00000380| 0d 09 6c 6f 6e 67 09 09 | 77 69 6e 64 6f 77 4e 75 |..long..|windowNu|
|00000390| 6d 20 3d 20 30 3b 0d 09 | 4f 53 45 72 72 09 09 65 |m = 0;..|OSErr..e|
|000003a0| 72 72 3b 0d 09 42 6f 6f | 6c 65 61 6e 09 09 67 65 |rr;..Boo|lean..ge|
|000003b0| 74 41 6c 6c 3b 0d 09 41 | 45 44 65 73 63 09 09 73 |tAll;..A|EDesc..s|
|000003c0| 63 72 61 74 63 68 54 6f | 6b 65 6e 3b 0d 09 53 74 |cratchTo|ken;..St|
|000003d0| 72 32 35 35 09 09 6e 61 | 6d 65 4b 65 79 20 3d 20 |r255..na|meKey = |
|000003e0| 22 22 2c 20 77 69 6e 64 | 6f 77 4e 61 6d 65 20 3d |"", wind|owName =|
|000003f0| 20 22 22 3b 0d 09 6c 6f | 6e 67 09 09 6e 61 6d 65 | "";..lo|ng..name|
|00000400| 4c 65 6e 67 74 68 3b 0d | 09 42 6f 6f 6c 65 61 6e |Length;.|.Boolean|
|00000410| 09 09 66 6f 75 6e 64 20 | 3d 20 66 61 6c 73 65 3b |..found |= false;|
|00000420| 0d 0d 09 73 77 69 74 63 | 68 20 28 6b 65 79 46 6f |...switc|h (keyFo|
|00000430| 72 6d 29 20 7b 0d 0d 09 | 09 63 61 73 65 20 66 6f |rm) {...|.case fo|
|00000440| 72 6d 41 62 73 6f 6c 75 | 74 65 50 6f 73 69 74 69 |rmAbsolu|tePositi|
|00000450| 6f 6e 3a 0d 09 09 09 67 | 65 74 41 6c 6c 20 3d 20 |on:....g|etAll = |
|00000460| 66 61 6c 73 65 3b 0d 09 | 09 09 2f 2a 20 45 78 74 |false;..|../* Ext|
|00000470| 72 61 63 74 20 74 68 65 | 20 6b 65 79 27 73 20 76 |ract the| key's v|
|00000480| 61 6c 75 65 2c 20 68 61 | 6e 64 6c 69 6e 67 20 61 |alue, ha|ndling a|
|00000490| 6e 79 20 6f 66 20 74 68 | 65 20 73 70 65 63 69 61 |ny of th|e specia|
|000004a0| 6c 20 63 6f 6e 73 74 61 | 6e 74 20 76 61 6c 75 65 |l consta|nt value|
|000004b0| 73 20 2a 2f 0d 09 09 09 | 65 72 72 20 3d 20 57 69 |s */....|err = Wi|
|000004c0| 6e 5f 43 6f 6e 76 65 72 | 74 41 62 73 4b 65 79 28 |n_Conver|tAbsKey(|
|000004d0| 6b 65 79 44 61 74 61 2c | 20 26 77 69 6e 64 6f 77 |keyData,| &window|
|000004e0| 4e 75 6d 2c 20 26 67 65 | 74 41 6c 6c 29 3b 0d 09 |Num, &ge|tAll);..|
|000004f0| 09 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00000500| 72 72 29 20 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |rr) retu|rn err;.|
|00000510| 0d 09 09 09 69 66 20 28 | 67 65 74 41 6c 6c 29 0d |....if (|getAll).|
|00000520| 09 09 09 09 72 65 74 75 | 72 6e 20 65 72 72 41 45 |....retu|rn errAE|
|00000530| 45 76 65 6e 74 46 61 69 | 6c 65 64 3b 09 2f 2a 20 |EventFai|led;./* |
|00000540| 57 65 20 64 6f 6e 27 74 | 20 68 61 6e 64 6c 65 20 |We don't| handle |
|00000550| 6d 75 6c 74 69 70 6c 65 | 20 77 69 6e 64 6f 77 73 |multiple| windows|
|00000560| 20 61 74 20 6f 6e 65 20 | 74 69 6d 65 20 2a 2f 0d | at one |time */.|
|00000570| 09 09 09 0d 09 09 09 63 | 75 72 72 57 69 6e 64 6f |.......c|urrWindo|
|00000580| 77 20 3d 20 46 69 6e 64 | 49 6e 64 65 78 65 64 57 |w = Find|IndexedW|
|00000590| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 4e 75 6d 29 |indow(wi|ndowNum)|
|000005a0| 3b 0d 09 09 09 69 66 20 | 28 63 75 72 72 57 69 6e |;....if |(currWin|
|000005b0| 64 6f 77 20 3d 3d 20 4e | 55 4c 4c 29 0d 09 09 09 |dow == N|ULL)....|
|000005c0| 09 72 65 74 75 72 6e 20 | 65 72 72 41 45 4e 6f 53 |.return |errAENoS|
|000005d0| 75 63 68 4f 62 6a 65 63 | 74 3b 0d 09 09 09 0d 09 |uchObjec|t;......|
|000005e0| 09 09 2f 2a 20 4e 6f 77 | 2c 20 62 75 69 6c 64 20 |../* Now|, build |
|000005f0| 61 20 74 6f 6b 65 6e 20 | 63 6f 6e 74 61 69 6e 69 |a token |containi|
|00000600| 6e 67 20 74 68 69 73 20 | 77 69 6e 64 6f 77 20 2a |ng this |window *|
|00000610| 2f 0d 09 09 09 42 75 69 | 6c 64 57 69 6e 64 6f 77 |/....Bui|ldWindow|
|00000620| 54 6f 6b 65 6e 28 63 75 | 72 72 57 69 6e 64 6f 77 |Token(cu|rrWindow|
|00000630| 2c 20 64 65 73 69 72 65 | 64 43 6c 61 73 73 2c 20 |, desire|dClass, |
|00000640| 63 6f 75 6e 74 2c 20 72 | 65 74 75 72 6e 65 64 54 |count, r|eturnedT|
|00000650| 6f 6b 65 6e 29 3b 0d 09 | 09 62 72 65 61 6b 3b 0d |oken);..|.break;.|
|00000660| 0d 09 09 63 61 73 65 20 | 66 6f 72 6d 4e 61 6d 65 |...case |formName|
|00000670| 3a 0d 09 09 09 2f 2a 20 | 47 65 74 20 74 68 65 20 |:..../* |Get the |
|00000680| 6e 75 6d 62 65 72 20 6f | 66 20 62 79 74 65 73 20 |number o|f bytes |
|00000690| 69 6e 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |in the s|pecified|
|000006a0| 20 77 69 6e 64 6f 77 20 | 6e 61 6d 65 20 2a 2f 0d | window |name */.|
|000006b0| 09 09 09 6e 61 6d 65 4c | 65 6e 67 74 68 20 3d 20 |...nameL|ength = |
|000006c0| 47 65 74 48 61 6e 64 6c | 65 53 69 7a 65 28 6b 65 |GetHandl|eSize(ke|
|000006d0| 79 44 61 74 61 2d 3e 64 | 61 74 61 48 61 6e 64 6c |yData->d|ataHandl|
|000006e0| 65 29 3b 0d 09 09 09 69 | 66 20 28 6e 61 6d 65 4c |e);....i|f (nameL|
|000006f0| 65 6e 67 74 68 20 3e 20 | 32 35 35 29 20 72 65 74 |ength > |255) ret|
|00000700| 75 72 6e 20 65 72 72 41 | 45 4e 6f 53 75 63 68 4f |urn errA|ENoSuchO|
|00000710| 62 6a 65 63 74 3b 0d 0d | 09 09 09 2f 2a 20 4d 6f |bject;..|.../* Mo|
|00000720| 76 65 20 74 68 65 20 6e | 61 6d 65 20 69 6e 74 6f |ve the n|ame into|
|00000730| 20 61 20 50 61 73 63 61 | 6c 2d 73 74 79 6c 65 20 | a Pasca|l-style |
|00000740| 73 74 72 69 6e 67 20 2a | 2f 0d 09 09 09 6e 61 6d |string *|/....nam|
|00000750| 65 4b 65 79 5b 30 5d 20 | 3d 20 28 63 68 61 72 29 |eKey[0] |= (char)|
|00000760| 6e 61 6d 65 4c 65 6e 67 | 74 68 3b 0d 09 09 09 42 |nameLeng|th;....B|
|00000770| 6c 6f 63 6b 4d 6f 76 65 | 28 2a 28 6b 65 79 44 61 |lockMove|(*(keyDa|
|00000780| 74 61 2d 3e 64 61 74 61 | 48 61 6e 64 6c 65 29 2c |ta->data|Handle),|
|00000790| 20 26 6e 61 6d 65 4b 65 | 79 5b 31 5d 2c 20 6e 61 | &nameKe|y[1], na|
|000007a0| 6d 65 4c 65 6e 67 74 68 | 29 3b 0d 0d 09 09 09 2f |meLength|);...../|
|000007b0| 2a 20 4e 6f 77 2c 20 73 | 65 61 72 63 68 20 66 6f |* Now, s|earch fo|
|000007c0| 72 20 61 20 77 69 6e 64 | 6f 77 20 77 69 74 68 20 |r a wind|ow with |
|000007d0| 74 68 65 20 73 61 6d 65 | 20 6e 61 6d 65 20 2a 2f |the same| name */|
|000007e0| 0d 09 09 09 63 6f 75 6e | 74 20 3d 20 31 3b 0d 09 |....coun|t = 1;..|
|000007f0| 09 09 77 68 69 6c 65 20 | 28 28 63 75 72 72 57 69 |..while |((currWi|
|00000800| 6e 64 6f 77 20 21 3d 20 | 4e 55 4c 4c 29 20 26 26 |ndow != |NULL) &&|
|00000810| 20 21 66 6f 75 6e 64 29 | 20 7b 0d 09 09 09 09 47 | !found)| {.....G|
|00000820| 65 74 57 54 69 74 6c 65 | 28 63 75 72 72 57 69 6e |etWTitle|(currWin|
|00000830| 64 6f 77 2c 20 77 69 6e | 64 6f 77 4e 61 6d 65 29 |dow, win|dowName)|
|00000840| 3b 0d 09 09 09 09 66 6f | 75 6e 64 20 3d 20 49 55 |;.....fo|und = IU|
|00000850| 45 71 75 61 6c 53 74 72 | 69 6e 67 28 6e 61 6d 65 |EqualStr|ing(name|
|00000860| 4b 65 79 2c 20 77 69 6e | 64 6f 77 4e 61 6d 65 29 |Key, win|dowName)|
|00000870| 20 3d 3d 20 30 3b 0d 09 | 09 09 09 69 66 20 28 66 | == 0;..|...if (f|
|00000880| 6f 75 6e 64 29 20 62 72 | 65 61 6b 3b 09 2f 2a 20 |ound) br|eak;./* |
|00000890| 45 78 69 74 20 74 68 65 | 20 77 68 69 6c 65 20 6c |Exit the| while l|
|000008a0| 6f 6f 70 20 2a 2f 0d 09 | 09 09 09 63 6f 75 6e 74 |oop */..|...count|
|000008b0| 2b 2b 3b 0d 09 09 09 09 | 63 75 72 72 57 69 6e 64 |++;.....|currWind|
|000008c0| 6f 77 20 3d 20 28 57 69 | 6e 64 6f 77 50 74 72 29 |ow = (Wi|ndowPtr)|
|000008d0| 28 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 63 75 |(((Windo|wPeek)cu|
|000008e0| 72 72 57 69 6e 64 6f 77 | 29 2d 3e 6e 65 78 74 57 |rrWindow|)->nextW|
|000008f0| 69 6e 64 6f 77 29 3b 0d | 09 09 09 7d 0d 09 09 09 |indow);.|...}....|
|00000900| 69 66 20 28 21 66 6f 75 | 6e 64 29 20 72 65 74 75 |if (!fou|nd) retu|
|00000910| 72 6e 20 65 72 72 41 45 | 4e 6f 53 75 63 68 4f 62 |rn errAE|NoSuchOb|
|00000920| 6a 65 63 74 3b 0d 0d 09 | 09 09 2f 2a 20 49 66 20 |ject;...|../* If |
|00000930| 74 68 65 20 77 69 6e 64 | 6f 77 20 77 61 73 20 66 |the wind|ow was f|
|00000940| 6f 75 6e 64 2c 20 74 68 | 65 6e 20 63 6f 6e 73 74 |ound, th|en const|
|00000950| 72 75 63 74 20 61 20 74 | 6f 6b 65 6e 20 74 6f 20 |ruct a t|oken to |
|00000960| 72 65 70 72 65 73 65 6e | 74 20 69 74 20 2a 2f 0d |represen|t it */.|
|00000970| 09 09 09 42 75 69 6c 64 | 57 69 6e 64 6f 77 54 6f |...Build|WindowTo|
|00000980| 6b 65 6e 28 63 75 72 72 | 57 69 6e 64 6f 77 2c 20 |ken(curr|Window, |
|00000990| 64 65 73 69 72 65 64 43 | 6c 61 73 73 2c 20 63 6f |desiredC|lass, co|
|000009a0| 75 6e 74 2c 20 72 65 74 | 75 72 6e 65 64 54 6f 6b |unt, ret|urnedTok|
|000009b0| 65 6e 29 3b 0d 09 09 62 | 72 65 61 6b 3b 0d 0d 09 |en);...b|reak;...|
|000009c0| 09 64 65 66 61 75 6c 74 | 3a 0d 09 09 09 72 65 74 |.default|:....ret|
|000009d0| 75 72 6e 20 65 72 72 41 | 45 45 76 65 6e 74 4e 6f |urn errA|EEventNo|
|000009e0| 74 48 61 6e 64 6c 65 64 | 3b 0d 09 7d 0d 0d 09 72 |tHandled|;..}...r|
|000009f0| 65 74 75 72 6e 20 6e 6f | 45 72 72 3b 0d 7d 09 2f |eturn no|Err;.}./|
|00000a00| 2a 20 20 57 69 6e 64 6f | 77 46 72 6f 6d 4e 75 6c |* Windo|wFromNul|
|00000a10| 6c 20 2a 2f 0d 0d 0d 2f | 2a 20 50 72 6f 70 65 72 |l */.../|* Proper|
|00000a20| 74 79 20 66 72 6f 6d 20 | 6f 62 6a 65 63 74 20 61 |ty from |object a|
|00000a30| 63 63 65 73 73 6f 72 73 | 20 2a 2f 0d 70 61 73 63 |ccessors| */.pasc|
|00000a40| 61 6c 20 4f 53 45 72 72 | 20 50 72 6f 70 65 72 74 |al OSErr| Propert|
|00000a50| 79 46 72 6f 6d 57 69 6e | 64 6f 77 41 63 63 65 73 |yFromWin|dowAcces|
|00000a60| 73 6f 72 20 28 20 44 65 | 73 63 54 79 70 65 20 64 |sor ( De|scType d|
|00000a70| 65 73 69 72 65 64 43 6c | 61 73 73 2c 0d 09 09 09 |esiredCl|ass,....|
|00000a80| 63 6f 6e 73 74 20 41 45 | 44 65 73 63 20 2a 63 6f |const AE|Desc *co|
|00000a90| 6e 74 61 69 6e 65 72 2c | 20 44 65 73 63 54 79 70 |ntainer,| DescTyp|
|00000aa0| 65 20 63 6f 6e 74 61 69 | 6e 65 72 43 6c 61 73 73 |e contai|nerClass|
|00000ab0| 2c 20 44 65 73 63 54 79 | 70 65 20 6b 65 79 46 6f |, DescTy|pe keyFo|
|00000ac0| 72 6d 2c 0d 09 09 09 63 | 6f 6e 73 74 20 41 45 44 |rm,....c|onst AED|
|00000ad0| 65 73 63 20 2a 6b 65 79 | 44 61 74 61 2c 20 41 45 |esc *key|Data, AE|
|00000ae0| 44 65 73 63 20 2a 72 65 | 74 75 72 6e 65 64 54 6f |Desc *re|turnedTo|
|00000af0| 6b 65 6e 2c 20 6c 6f 6e | 67 20 72 65 66 43 6f 6e |ken, lon|g refCon|
|00000b00| 20 29 0d 7b 0d 09 4f 53 | 45 72 72 09 09 65 72 72 | ).{..OS|Err..err|
|00000b10| 20 3d 20 6e 6f 45 72 72 | 3b 0d 09 42 6f 6f 6c 65 | = noErr|;..Boole|
|00000b20| 61 6e 09 09 6f 6b 3b 0d | 09 44 65 73 63 54 79 70 |an..ok;.|.DescTyp|
|00000b30| 65 09 72 65 71 75 65 73 | 74 65 64 50 72 6f 70 65 |e.reques|tedPrope|
|00000b40| 72 74 79 3b 0d 09 0d 09 | 69 66 20 28 28 6b 65 79 |rty;....|if ((key|
|00000b50| 46 6f 72 6d 20 21 3d 20 | 66 6f 72 6d 50 72 6f 70 |Form != |formProp|
|00000b60| 65 72 74 79 49 44 29 20 | 7c 7c 20 28 6b 65 79 44 |ertyID) ||| (keyD|
|00000b70| 61 74 61 2d 3e 64 65 73 | 63 72 69 70 74 6f 72 54 |ata->des|criptorT|
|00000b80| 79 70 65 20 21 3d 20 74 | 79 70 65 54 79 70 65 29 |ype != t|ypeType)|
|00000b90| 29 0d 09 09 72 65 74 75 | 72 6e 20 65 72 72 41 45 |)...retu|rn errAE|
|00000ba0| 43 61 6e 74 53 75 70 70 | 6c 79 54 79 70 65 3b 0d |CantSupp|lyType;.|
|00000bb0| 0d 09 69 66 20 28 28 63 | 6f 6e 74 61 69 6e 65 72 |..if ((c|ontainer|
|00000bc0| 2d 3e 64 65 73 63 72 69 | 70 74 6f 72 54 79 70 65 |->descri|ptorType|
|00000bd0| 20 21 3d 20 63 57 69 6e | 64 6f 77 29 20 26 26 20 | != cWin|dow) && |
|00000be0| 28 63 6f 6e 74 61 69 6e | 65 72 2d 3e 64 65 73 63 |(contain|er->desc|
|00000bf0| 72 69 70 74 6f 72 54 79 | 70 65 20 21 3d 20 63 44 |riptorTy|pe != cD|
|00000c00| 6f 63 75 6d 65 6e 74 29 | 29 0d 09 09 72 65 74 75 |ocument)|)...retu|
|00000c10| 72 6e 20 65 72 72 41 45 | 54 79 70 65 45 72 72 6f |rn errAE|TypeErro|
|00000c20| 72 3b 0d 0d 09 72 65 71 | 75 65 73 74 65 64 50 72 |r;...req|uestedPr|
|00000c30| 6f 70 65 72 74 79 20 3d | 20 2a 2a 28 44 65 73 63 |operty =| **(Desc|
|00000c40| 54 79 70 65 2a 2a 29 6b | 65 79 44 61 74 61 2d 3e |Type**)k|eyData->|
|00000c50| 64 61 74 61 48 61 6e 64 | 6c 65 3b 0d 09 0d 09 2f |dataHand|le;..../|
|00000c60| 2a 20 43 68 65 63 6b 20 | 74 6f 20 73 65 65 20 69 |* Check |to see i|
|00000c70| 66 20 74 68 69 73 20 69 | 73 20 61 20 6c 65 67 61 |f this i|s a lega|
|00000c80| 6c 20 70 72 6f 70 65 72 | 74 79 20 63 6f 64 65 20 |l proper|ty code |
|00000c90| 66 6f 72 20 74 68 69 73 | 20 6f 62 6a 65 63 74 20 |for this| object |
|00000ca0| 63 6c 61 73 73 20 2a 2f | 0d 09 6f 6b 20 3d 20 66 |class */|..ok = f|
|00000cb0| 61 6c 73 65 3b 0d 09 73 | 77 69 74 63 68 20 28 72 |alse;..s|witch (r|
|00000cc0| 65 71 75 65 73 74 65 64 | 50 72 6f 70 65 72 74 79 |equested|Property|
|00000cd0| 29 20 7b 0d 09 09 2f 2a | 20 20 72 65 61 64 2d 6f |) {.../*| read-o|
|00000ce0| 6e 6c 79 20 70 72 6f 70 | 65 72 74 69 65 73 20 63 |nly prop|erties c|
|00000cf0| 6f 6d 6d 6f 6e 20 74 6f | 20 63 57 69 6e 64 6f 77 |ommon to| cWindow|
|00000d00| 20 61 6e 64 20 63 44 6f | 63 75 6d 65 6e 74 20 2a | and cDo|cument *|
|00000d10| 2f 0d 09 09 63 61 73 65 | 20 70 42 65 73 74 54 79 |/...case| pBestTy|
|00000d20| 70 65 3a 0d 09 09 63 61 | 73 65 20 70 43 6c 61 73 |pe:...ca|se pClas|
|00000d30| 73 3a 0d 09 09 63 61 73 | 65 20 70 44 65 66 61 75 |s:...cas|e pDefau|
|00000d40| 6c 74 54 79 70 65 3a 0d | 09 09 09 6f 6b 20 3d 20 |ltType:.|...ok = |
|00000d50| 74 72 75 65 3b 0d 09 09 | 62 72 65 61 6b 3b 0d 0d |true;...|break;..|
|00000d60| 09 09 2f 2a 20 20 72 65 | 61 64 2d 6f 6e 6c 79 20 |../* re|ad-only |
|00000d70| 70 72 6f 70 65 72 74 69 | 65 73 20 75 6e 69 71 75 |properti|es uniqu|
|00000d80| 65 20 74 6f 20 63 57 69 | 6e 64 6f 77 20 2a 2f 0d |e to cWi|ndow */.|
|00000d90| 09 09 63 61 73 65 20 70 | 48 61 73 43 6c 6f 73 65 |..case p|HasClose|
|00000da0| 42 6f 78 3a 0d 09 09 63 | 61 73 65 20 70 48 61 73 |Box:...c|ase pHas|
|00000db0| 54 69 74 6c 65 42 61 72 | 3a 0d 09 09 63 61 73 65 |TitleBar|:...case|
|00000dc0| 20 70 49 73 46 6c 6f 61 | 74 69 6e 67 3a 0d 09 09 | pIsFloa|ting:...|
|00000dd0| 63 61 73 65 20 70 49 73 | 4d 6f 64 61 6c 3a 0d 09 |case pIs|Modal:..|
|00000de0| 09 63 61 73 65 20 70 49 | 73 52 65 73 69 7a 61 62 |.case pI|sResizab|
|00000df0| 6c 65 3a 0d 09 09 63 61 | 73 65 20 70 49 73 5a 6f |le:...ca|se pIsZo|
|00000e00| 6f 6d 61 62 6c 65 3a 0d | 09 09 09 69 66 20 28 63 |omable:.|...if (c|
|00000e10| 6f 6e 74 61 69 6e 65 72 | 43 6c 61 73 73 20 3d 3d |ontainer|Class ==|
|00000e20| 20 63 57 69 6e 64 6f 77 | 29 20 0d 09 09 09 09 6f | cWindow|) .....o|
|00000e30| 6b 20 3d 20 74 72 75 65 | 3b 0d 09 09 62 72 65 61 |k = true|;...brea|
|00000e40| 6b 3b 0d 0d 09 09 2f 2a | 20 20 72 65 61 64 2d 6f |k;..../*| read-o|
|00000e50| 6e 6c 79 20 70 72 6f 70 | 65 72 74 69 65 73 20 75 |nly prop|erties u|
|00000e60| 6e 69 71 75 65 20 74 6f | 20 61 20 63 44 6f 63 75 |nique to| a cDocu|
|00000e70| 6d 65 6e 74 20 2a 2f 0d | 09 09 63 61 73 65 20 70 |ment */.|..case p|
|00000e80| 49 73 4d 6f 64 69 66 69 | 65 64 3a 0d 09 09 09 69 |IsModifi|ed:....i|
|00000e90| 66 20 28 63 6f 6e 74 61 | 69 6e 65 72 43 6c 61 73 |f (conta|inerClas|
|00000ea0| 73 20 3d 3d 20 63 44 6f | 63 75 6d 65 6e 74 29 20 |s == cDo|cument) |
|00000eb0| 0d 09 09 09 09 6f 6b 20 | 3d 20 74 72 75 65 3b 0d |.....ok |= true;.|
|00000ec0| 09 09 62 72 65 61 6b 3b | 0d 09 09 0d 09 09 2f 2a |..break;|....../*|
|00000ed0| 20 20 6d 6f 64 69 66 69 | 61 62 6c 65 20 70 72 6f | modifi|able pro|
|00000ee0| 70 65 72 74 69 65 73 20 | 63 6f 6d 6d 6f 6e 20 74 |perties |common t|
|00000ef0| 6f 20 63 57 69 6e 64 6f | 77 20 61 6e 64 20 63 44 |o cWindo|w and cD|
|00000f00| 6f 63 75 6d 65 6e 74 20 | 2a 2f 0d 09 09 63 61 73 |ocument |*/...cas|
|00000f10| 65 20 70 4e 61 6d 65 3a | 0d 09 09 09 6f 6b 20 3d |e pName:|....ok =|
|00000f20| 20 74 72 75 65 3b 0d 09 | 09 62 72 65 61 6b 3b 0d | true;..|.break;.|
|00000f30| 09 09 0d 09 09 2f 2a 20 | 20 6d 6f 64 69 66 69 61 |...../* | modifia|
|00000f40| 62 6c 65 20 70 72 6f 70 | 65 72 74 69 65 73 20 75 |ble prop|erties u|
|00000f50| 6e 69 71 75 65 20 74 6f | 20 63 57 69 6e 64 6f 77 |nique to| cWindow|
|00000f60| 20 2a 2f 0d 09 09 63 61 | 73 65 20 70 42 6f 75 6e | */...ca|se pBoun|
|00000f70| 64 73 3a 0d 09 09 63 61 | 73 65 20 70 49 6e 64 65 |ds:...ca|se pInde|
|00000f80| 78 3a 0d 09 09 63 61 73 | 65 20 70 49 73 5a 6f 6f |x:...cas|e pIsZoo|
|00000f90| 6d 65 64 3a 0d 09 09 63 | 61 73 65 20 70 53 65 6c |med:...c|ase pSel|
|00000fa0| 65 63 74 69 6f 6e 3a 0d | 09 09 63 61 73 65 20 70 |ection:.|..case p|
|00000fb0| 56 69 73 69 62 6c 65 3a | 0d 09 09 09 69 66 20 28 |Visible:|....if (|
|00000fc0| 63 6f 6e 74 61 69 6e 65 | 72 43 6c 61 73 73 20 3d |containe|rClass =|
|00000fd0| 3d 20 63 57 69 6e 64 6f | 77 29 20 0d 09 09 09 09 |= cWindo|w) .....|
|00000fe0| 6f 6b 20 3d 20 74 72 75 | 65 3b 0d 09 09 62 72 65 |ok = tru|e;...bre|
|00000ff0| 61 6b 3b 0d 09 7d 0d 09 | 0d 09 69 66 20 28 6f 6b |ak;..}..|..if (ok|
|00001000| 29 20 7b 0d 09 09 2f 2a | 20 43 6f 70 79 20 74 68 |) {.../*| Copy th|
|00001010| 65 20 63 6f 6e 74 61 69 | 6e 65 72 20 61 6e 64 20 |e contai|ner and |
|00001020| 63 6f 6e 76 65 72 74 20 | 69 74 20 69 6e 74 6f 20 |convert |it into |
|00001030| 61 20 70 72 6f 70 65 72 | 74 79 20 74 6f 6b 65 6e |a proper|ty token|
|00001040| 20 2a 2f 0d 09 09 65 72 | 72 20 3d 20 41 45 44 75 | */...er|r = AEDu|
|00001050| 70 6c 69 63 61 74 65 44 | 65 73 63 28 63 6f 6e 74 |plicateD|esc(cont|
|00001060| 61 69 6e 65 72 2c 20 72 | 65 74 75 72 6e 65 64 54 |ainer, r|eturnedT|
|00001070| 6f 6b 65 6e 29 3b 0d 09 | 09 69 66 20 28 65 72 72 |oken);..|.if (err|
|00001080| 20 3d 3d 20 6e 6f 45 72 | 72 29 20 7b 0d 09 09 09 | == noEr|r) {....|
|00001090| 74 6f 6b 65 6e 46 6c 61 | 67 73 28 2a 72 65 74 75 |tokenFla|gs(*retu|
|000010a0| 72 6e 65 64 54 6f 6b 65 | 6e 29 20 3d 20 6b 50 72 |rnedToke|n) = kPr|
|000010b0| 6f 70 54 6f 6b 65 6e 3b | 0d 09 09 09 74 6f 6b 65 |opToken;|....toke|
|000010c0| 6e 50 72 6f 70 43 6f 64 | 65 28 2a 72 65 74 75 72 |nPropCod|e(*retur|
|000010d0| 6e 65 64 54 6f 6b 65 6e | 29 20 3d 20 72 65 71 75 |nedToken|) = requ|
|000010e0| 65 73 74 65 64 50 72 6f | 70 65 72 74 79 3b 0d 09 |estedPro|perty;..|
|000010f0| 09 7d 0d 09 09 72 65 74 | 75 72 6e 20 65 72 72 3b |.}...ret|urn err;|
|00001100| 0d 09 7d 20 65 6c 73 65 | 20 0d 09 09 72 65 74 75 |..} else| ...retu|
|00001110| 72 6e 20 65 72 72 41 45 | 4e 6f 53 75 63 68 4f 62 |rn errAE|NoSuchOb|
|00001120| 6a 65 63 74 3b 20 2f 2a | 20 20 57 65 20 72 65 61 |ject; /*| We rea|
|00001130| 6c 6c 79 20 77 61 6e 74 | 20 22 6e 6f 74 20 61 20 |lly want| "not a |
|00001140| 70 72 6f 70 65 72 74 79 | 22 2c 20 62 75 74 20 74 |property|", but t|
|00001150| 68 61 74 20 69 73 6e 27 | 74 20 64 65 66 69 6e 65 |hat isn'|t define|
|00001160| 64 20 20 2a 2f 0d 7d 20 | 2f 2a 20 50 72 6f 70 65 |d */.} |/* Prope|
|00001170| 72 74 79 46 72 6f 6d 57 | 69 6e 64 6f 77 41 63 63 |rtyFromW|indowAcc|
|00001180| 65 73 73 6f 72 20 2a 2f | 0d 0d 0d 2f 2a 20 3d 3d |essor */|.../* ==|
|00001190| 3d 20 48 61 6e 64 79 20 | 75 74 69 6c 69 74 69 65 |= Handy |utilitie|
|000011a0| 73 20 3d 3d 3d 20 2a 2f | 0d 0d 6c 6f 6e 67 20 43 |s === */|..long C|
|000011b0| 6f 75 6e 74 57 69 6e 64 | 6f 77 73 28 29 0d 7b 0d |ountWind|ows().{.|
|000011c0| 09 57 69 6e 64 6f 77 50 | 74 72 09 63 75 72 72 57 |.WindowP|tr.currW|
|000011d0| 69 6e 64 6f 77 20 3d 20 | 46 72 6f 6e 74 57 69 6e |indow = |FrontWin|
|000011e0| 64 6f 77 28 29 3b 0d 09 | 6c 6f 6e 67 09 09 63 6f |dow();..|long..co|
|000011f0| 75 6e 74 20 3d 20 30 3b | 0d 0d 09 77 68 69 6c 65 |unt = 0;|...while|
|00001200| 20 28 63 75 72 72 57 69 | 6e 64 6f 77 20 21 3d 20 | (currWi|ndow != |
|00001210| 4e 55 4c 4c 29 20 7b 0d | 09 09 63 6f 75 6e 74 2b |NULL) {.|..count+|
|00001220| 2b 3b 0d 09 09 63 75 72 | 72 57 69 6e 64 6f 77 20 |+;...cur|rWindow |
|00001230| 3d 20 28 57 69 6e 64 6f | 77 50 74 72 29 28 28 28 |= (Windo|wPtr)(((|
|00001240| 57 69 6e 64 6f 77 50 65 | 65 6b 29 63 75 72 72 57 |WindowPe|ek)currW|
|00001250| 69 6e 64 6f 77 29 2d 3e | 6e 65 78 74 57 69 6e 64 |indow)->|nextWind|
|00001260| 6f 77 29 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |ow);..}.|.return |
|00001270| 63 6f 75 6e 74 3b 0d 7d | 20 2f 2a 20 43 6f 75 6e |count;.}| /* Coun|
|00001280| 74 57 69 6e 64 6f 77 73 | 20 2a 2f 0d 0d 0d 6c 6f |tWindows| */...lo|
|00001290| 6e 67 20 47 65 74 57 69 | 6e 64 6f 77 49 6e 64 65 |ng GetWi|ndowInde|
|000012a0| 78 28 57 69 6e 64 6f 77 | 50 74 72 20 74 68 65 57 |x(Window|Ptr theW|
|000012b0| 69 6e 64 6f 77 29 0d 2f | 2a 20 20 47 69 76 65 6e |indow)./|* Given|
|000012c0| 20 61 20 77 69 6e 64 6f | 77 50 74 72 2c 20 72 65 | a windo|wPtr, re|
|000012d0| 74 75 72 6e 20 69 74 73 | 20 69 6e 64 65 78 20 28 |turn its| index (|
|000012e0| 66 72 6f 6e 74 6d 6f 73 | 74 20 77 69 6e 64 6f 77 |frontmos|t window|
|000012f0| 20 3d 20 31 2c 20 6e 65 | 78 74 20 62 61 63 6b 20 | = 1, ne|xt back |
|00001300| 3d 20 32 2c 20 65 74 63 | 2e 29 20 2a 2f 0d 7b 0d |= 2, etc|.) */.{.|
|00001310| 09 57 69 6e 64 6f 77 50 | 74 72 09 63 75 72 72 57 |.WindowP|tr.currW|
|00001320| 69 6e 64 6f 77 20 3d 20 | 46 72 6f 6e 74 57 69 6e |indow = |FrontWin|
|00001330| 64 6f 77 28 29 3b 0d 09 | 6c 6f 6e 67 09 09 63 6f |dow();..|long..co|
|00001340| 75 6e 74 20 3d 20 31 3b | 0d 0d 0d 09 77 68 69 6c |unt = 1;|....whil|
|00001350| 65 20 28 63 75 72 72 57 | 69 6e 64 6f 77 20 21 3d |e (currW|indow !=|
|00001360| 20 74 68 65 57 69 6e 64 | 6f 77 29 20 7b 0d 09 09 | theWind|ow) {...|
|00001370| 69 66 20 28 63 75 72 72 | 57 69 6e 64 6f 77 20 3d |if (curr|Window =|
|00001380| 3d 20 4e 55 4c 4c 29 20 | 0d 09 09 09 72 65 74 75 |= NULL) |....retu|
|00001390| 72 6e 20 30 3b 0d 09 09 | 63 6f 75 6e 74 2b 2b 3b |rn 0;...|count++;|
|000013a0| 0d 09 09 63 75 72 72 57 | 69 6e 64 6f 77 20 3d 20 |...currW|indow = |
|000013b0| 28 57 69 6e 64 6f 77 50 | 74 72 29 28 28 28 57 69 |(WindowP|tr)(((Wi|
|000013c0| 6e 64 6f 77 50 65 65 6b | 29 63 75 72 72 57 69 6e |ndowPeek|)currWin|
|000013d0| 64 6f 77 29 2d 3e 6e 65 | 78 74 57 69 6e 64 6f 77 |dow)->ne|xtWindow|
|000013e0| 29 3b 0d 09 7d 0d 09 72 | 65 74 75 72 6e 20 63 6f |);..}..r|eturn co|
|000013f0| 75 6e 74 3b 0d 7d 20 2f | 2a 20 47 65 74 57 69 6e |unt;.} /|* GetWin|
|00001400| 64 6f 77 49 6e 64 65 78 | 20 2a 2f 0d 0d 0d 57 69 |dowIndex| */...Wi|
|00001410| 6e 64 6f 77 50 74 72 20 | 46 69 6e 64 49 6e 64 65 |ndowPtr |FindInde|
|00001420| 78 65 64 57 69 6e 64 6f | 77 28 6c 6f 6e 67 20 69 |xedWindo|w(long i|
|00001430| 6e 64 65 78 29 0d 2f 2a | 20 54 68 69 73 20 72 6f |ndex)./*| This ro|
|00001440| 75 74 69 6e 65 20 73 65 | 61 72 63 68 65 73 20 74 |utine se|arches t|
|00001450| 68 65 20 77 69 6e 64 6f | 77 20 6c 69 73 74 20 66 |he windo|w list f|
|00001460| 6f 72 20 74 68 65 20 77 | 69 6e 64 6f 77 20 77 69 |or the w|indow wi|
|00001470| 74 68 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |th the s|pecified|
|00001480| 20 69 6e 64 65 78 20 2a | 2f 0d 2f 2a 20 54 68 69 | index *|/./* Thi|
|00001490| 73 20 69 73 20 75 73 65 | 64 20 69 6e 20 63 6f 6e |s is use|d in con|
|000014a0| 6a 75 6e 63 74 69 6f 6e | 20 77 69 74 68 20 57 69 |junction| with Wi|
|000014b0| 6e 5f 43 72 65 61 74 65 | 45 6c 65 6d 65 6e 74 20 |n_Create|Element |
|000014c0| 74 6f 20 69 6e 64 69 63 | 61 74 65 20 77 68 65 72 |to indic|ate wher|
|000014d0| 65 20 74 68 65 20 6e 65 | 77 20 20 2a 2f 0d 2f 2a |e the ne|w */./*|
|000014e0| 20 77 69 6e 64 6f 77 20 | 73 68 6f 75 6c 64 20 67 | window |should g|
|000014f0| 6f 2e 20 2a 2f 0d 7b 0d | 09 57 69 6e 64 6f 77 50 |o. */.{.|.WindowP|
|00001500| 65 65 6b 09 72 65 73 75 | 6c 74 3b 0d 09 0d 09 69 |eek.resu|lt;....i|
|00001510| 66 20 28 69 6e 64 65 78 | 20 3c 3d 20 30 29 0d 09 |f (index| <= 0)..|
|00001520| 09 72 65 73 75 6c 74 20 | 3d 20 28 57 69 6e 64 6f |.result |= (Windo|
|00001530| 77 50 65 65 6b 29 2d 31 | 3b 09 2f 2a 20 53 70 65 |wPeek)-1|;./* Spe|
|00001540| 63 69 61 6c 20 76 61 6c | 75 65 20 66 6f 72 20 22 |cial val|ue for "|
|00001550| 69 6e 20 66 72 6f 6e 74 | 20 6f 66 20 74 68 65 20 |in front| of the |
|00001560| 66 72 6f 6e 74 6d 6f 73 | 74 20 77 69 6e 64 6f 77 |frontmos|t window|
|00001570| 22 20 2a 2f 0d 09 65 6c | 73 65 20 7b 0d 09 09 72 |" */..el|se {...r|
|00001580| 65 73 75 6c 74 20 3d 20 | 28 57 69 6e 64 6f 77 50 |esult = |(WindowP|
|00001590| 65 65 6b 29 46 72 6f 6e | 74 57 69 6e 64 6f 77 28 |eek)Fron|tWindow(|
|000015a0| 29 3b 0d 09 09 77 68 69 | 6c 65 20 28 28 69 6e 64 |);...whi|le ((ind|
|000015b0| 65 78 20 3e 20 31 29 20 | 26 26 20 28 72 65 73 75 |ex > 1) |&& (resu|
|000015c0| 6c 74 20 21 3d 20 4e 55 | 4c 4c 29 29 20 7b 0d 09 |lt != NU|LL)) {..|
|000015d0| 09 09 69 66 20 28 72 65 | 73 75 6c 74 2d 3e 76 69 |..if (re|sult->vi|
|000015e0| 73 69 62 6c 65 29 0d 09 | 09 09 09 2d 2d 69 6e 64 |sible)..|...--ind|
|000015f0| 65 78 3b 0d 09 09 09 72 | 65 73 75 6c 74 20 3d 20 |ex;....r|esult = |
|00001600| 72 65 73 75 6c 74 2d 3e | 6e 65 78 74 57 69 6e 64 |result->|nextWind|
|00001610| 6f 77 3b 0d 09 09 7d 0d | 09 7d 0d 09 72 65 74 75 |ow;...}.|.}..retu|
|00001620| 72 6e 20 28 57 69 6e 64 | 6f 77 50 74 72 29 72 65 |rn (Wind|owPtr)re|
|00001630| 73 75 6c 74 3b 0d 7d 0d | 0d 0d 4f 53 45 72 72 20 |sult;.}.|..OSErr |
|00001640| 57 69 6e 5f 43 6f 6e 76 | 65 72 74 41 62 73 4b 65 |Win_Conv|ertAbsKe|
|00001650| 79 28 63 6f 6e 73 74 20 | 41 45 44 65 73 63 20 2a |y(const |AEDesc *|
|00001660| 6b 65 79 44 61 74 61 2c | 20 6c 6f 6e 67 20 2a 69 |keyData,| long *i|
|00001670| 6e 64 65 78 2c 20 42 6f | 6f 6c 65 61 6e 20 2a 67 |ndex, Bo|olean *g|
|00001680| 65 74 41 6c 6c 29 0d 2f | 2a 20 54 68 69 73 20 72 |etAll)./|* This r|
|00001690| 6f 75 74 69 6e 65 20 65 | 78 74 72 61 63 74 73 20 |outine e|xtracts |
|000016a0| 74 68 65 20 76 61 6c 75 | 65 20 66 72 6f 6d 20 61 |the valu|e from a|
|000016b0| 20 66 6f 72 6d 41 62 73 | 6f 6c 75 74 65 50 6f 73 | formAbs|olutePos|
|000016c0| 69 74 69 6f 6e 20 6b 65 | 79 2c 20 69 6e 63 6c 75 |ition ke|y, inclu|
|000016d0| 64 69 6e 67 20 74 68 65 | 20 73 70 65 63 69 61 6c |ding the| special|
|000016e0| 20 2a 2f 0d 2f 2a 20 22 | 66 69 72 73 74 22 2c 20 | */./* "|first", |
|000016f0| 22 6c 61 73 74 22 2c 20 | 61 6e 79 22 2c 20 22 61 |"last", |any", "a|
|00001700| 6c 6c 22 2c 20 61 6e 64 | 20 22 6d 69 64 64 6c 65 |ll", and| "middle|
|00001710| 22 20 63 6f 6e 73 74 61 | 6e 74 73 2e 20 20 2a 2f |" consta|nts. */|
|00001720| 0d 7b 0d 09 6c 6f 6e 67 | 20 09 6e 75 6d 57 69 6e |.{..long| .numWin|
|00001730| 64 6f 77 73 20 3d 20 43 | 6f 75 6e 74 57 69 6e 64 |dows = C|ountWind|
|00001740| 6f 77 73 28 29 3b 0d 09 | 6c 6f 6e 67 09 72 61 77 |ows();..|long.raw|
|00001750| 49 6e 64 65 78 3b 0d 09 | 0d 09 2f 2a 20 20 54 68 |Index;..|../* Th|
|00001760| 65 72 65 20 61 72 65 20 | 33 20 66 6c 61 76 6f 72 |ere are |3 flavor|
|00001770| 73 20 6f 66 20 66 6f 72 | 6d 41 62 73 6f 6c 75 74 |s of for|mAbsolut|
|00001780| 65 50 6f 73 69 74 69 6f | 6e 20 6b 65 79 20 2d 2d |ePositio|n key --|
|00001790| 20 74 79 70 65 49 6e 64 | 65 78 44 65 73 63 72 69 | typeInd|exDescri|
|000017a0| 70 74 6f 72 20 28 70 6f | 73 69 74 69 6f 6e 20 31 |ptor (po|sition 1|
|000017b0| 2c 20 32 2c 20 33 c9 29 | 2c 20 2a 2f 0d 09 2f 2a |, 2, 3.)|, */../*|
|000017c0| 20 20 74 79 70 65 52 65 | 6c 61 74 69 76 65 44 65 | typeRe|lativeDe|
|000017d0| 73 63 72 69 70 74 6f 72 | 20 28 31 20 66 72 6f 6d |scriptor| (1 from|
|000017e0| 20 74 68 65 20 62 65 67 | 69 6e 6e 69 6e 67 2c 20 | the beg|inning, |
|000017f0| 32 20 66 72 6f 6d 20 74 | 68 65 20 62 65 67 69 6e |2 from t|he begin|
|00001800| 6e 69 6e 67 2c 20 31 20 | 66 72 6f 6d 20 74 68 65 |ning, 1 |from the|
|00001810| 20 65 6e 64 20 28 2d 31 | 29 2c 20 2a 2f 0d 09 2f | end (-1|), */../|
|00001820| 2a 20 20 32 20 66 72 6f | 6d 20 74 68 65 20 65 6e |* 2 fro|m the en|
|00001830| 64 20 28 2d 32 29 2c 20 | 65 74 63 2e 29 20 6f 72 |d (-2), |etc.) or|
|00001840| 20 74 79 70 65 41 62 73 | 6f 6c 75 74 65 4f 72 64 | typeAbs|oluteOrd|
|00001850| 69 6e 61 6c 20 28 66 69 | 72 73 74 2c 20 6c 61 73 |inal (fi|rst, las|
|00001860| 74 2c 20 6d 69 64 64 6c | 65 2c 20 61 6e 79 2c 20 |t, middl|e, any, |
|00001870| 61 6e 64 20 61 6c 6c 29 | 2e 20 2a 2f 0d 09 2f 2a |and all)|. */../*|
|00001880| 20 20 57 65 27 6c 6c 20 | 68 61 6e 64 6c 65 20 65 | We'll |handle e|
|00001890| 61 63 68 20 6f 66 20 74 | 68 65 73 65 20 66 6f 72 |ach of t|hese for|
|000018a0| 6d 73 20 69 6e 20 74 75 | 72 6e 20 2a 2f 0d 09 0d |ms in tu|rn */...|
|000018b0| 09 2a 67 65 74 41 6c 6c | 20 3d 20 46 41 4c 53 45 |.*getAll| = FALSE|
|000018c0| 3b 0d 09 72 61 77 49 6e | 64 65 78 20 3d 20 2a 2a |;..rawIn|dex = **|
|000018d0| 28 28 6c 6f 6e 67 2a 2a | 29 6b 65 79 44 61 74 61 |((long**|)keyData|
|000018e0| 2d 3e 64 61 74 61 48 61 | 6e 64 6c 65 29 3b 09 09 |->dataHa|ndle);..|
|000018f0| 2f 2a 20 47 65 74 20 74 | 68 65 20 6e 75 6d 62 65 |/* Get t|he numbe|
|00001900| 72 20 6f 75 74 20 6f 66 | 20 74 68 65 20 6b 65 79 |r out of| the key|
|00001910| 20 2a 2f 0d 09 73 77 69 | 74 63 68 20 28 6b 65 79 | */..swi|tch (key|
|00001920| 44 61 74 61 2d 3e 64 65 | 73 63 72 69 70 74 6f 72 |Data->de|scriptor|
|00001930| 54 79 70 65 29 20 7b 0d | 09 09 63 61 73 65 20 74 |Type) {.|..case t|
|00001940| 79 70 65 52 65 6c 61 74 | 69 76 65 44 65 73 63 72 |ypeRelat|iveDescr|
|00001950| 69 70 74 6f 72 3a 0d 09 | 09 09 69 66 20 28 72 61 |iptor:..|..if (ra|
|00001960| 77 49 6e 64 65 78 20 3c | 20 30 29 0d 09 09 09 09 |wIndex <| 0).....|
|00001970| 2f 2a 20 41 20 6e 65 67 | 61 74 69 76 65 20 76 61 |/* A neg|ative va|
|00001980| 6c 75 65 20 6d 65 61 6e | 73 20 22 74 68 65 20 4e |lue mean|s "the N|
|00001990| 74 68 20 6f 62 6a 65 63 | 74 20 66 72 6f 6d 20 74 |th objec|t from t|
|000019a0| 68 65 20 65 6e 64 22 2c | 20 2a 2f 0d 09 09 09 09 |he end",| */.....|
|000019b0| 2f 2a 20 69 2e 65 2e 20 | 2d 31 20 3d 3d 20 74 68 |/* i.e. |-1 == th|
|000019c0| 65 20 6c 61 73 74 20 6f | 62 6a 65 63 74 20 2a 2f |e last o|bject */|
|000019d0| 0d 09 09 09 09 72 61 77 | 49 6e 64 65 78 20 3d 20 |.....raw|Index = |
|000019e0| 6e 75 6d 57 69 6e 64 6f | 77 73 20 2b 20 72 61 77 |numWindo|ws + raw|
|000019f0| 49 6e 64 65 78 20 2b 20 | 31 3b 0d 09 09 09 2f 2a |Index + |1;..../*|
|00001a00| 20 20 4f 74 68 65 72 77 | 69 73 65 20 74 68 65 20 | Otherw|ise the |
|00001a10| 6e 75 6d 62 65 72 20 69 | 73 20 70 6f 73 69 74 69 |number i|s positi|
|00001a20| 76 65 2c 20 61 6e 64 20 | 77 65 20 74 72 65 61 74 |ve, and |we treat|
|00001a30| 20 69 74 20 6c 69 6b 65 | 20 61 20 72 65 67 75 6c | it like| a regul|
|00001a40| 61 72 20 69 6e 64 65 78 | 20 2a 2f 0d 09 09 62 72 |ar index| */...br|
|00001a50| 65 61 6b 3b 0d 09 09 0d | 09 09 63 61 73 65 20 74 |eak;....|..case t|
|00001a60| 79 70 65 41 62 73 6f 6c | 75 74 65 4f 72 64 69 6e |ypeAbsol|uteOrdin|
|00001a70| 61 6c 3a 0d 09 09 09 69 | 66 20 28 72 61 77 49 6e |al:....i|f (rawIn|
|00001a80| 64 65 78 20 3d 3d 20 6b | 41 45 46 69 72 73 74 29 |dex == k|AEFirst)|
|00001a90| 0d 09 09 09 09 72 61 77 | 49 6e 64 65 78 20 3d 20 |.....raw|Index = |
|00001aa0| 31 3b 0d 09 09 09 65 6c | 73 65 20 69 66 20 28 72 |1;....el|se if (r|
|00001ab0| 61 77 49 6e 64 65 78 20 | 3d 3d 20 6b 41 45 4c 61 |awIndex |== kAELa|
|00001ac0| 73 74 29 0d 09 09 09 09 | 72 61 77 49 6e 64 65 78 |st).....|rawIndex|
|00001ad0| 20 3d 20 6e 75 6d 57 69 | 6e 64 6f 77 73 3b 0d 09 | = numWi|ndows;..|
|00001ae0| 09 09 65 6c 73 65 20 69 | 66 20 28 72 61 77 49 6e |..else i|f (rawIn|
|00001af0| 64 65 78 20 3d 3d 20 6b | 41 45 4d 69 64 64 6c 65 |dex == k|AEMiddle|
|00001b00| 29 0d 09 09 09 09 72 61 | 77 49 6e 64 65 78 20 3d |).....ra|wIndex =|
|00001b10| 20 6e 75 6d 57 69 6e 64 | 6f 77 73 20 2f 20 32 3b | numWind|ows / 2;|
|00001b20| 0d 09 09 09 65 6c 73 65 | 20 69 66 20 28 72 61 77 |....else| if (raw|
|00001b30| 49 6e 64 65 78 20 3d 3d | 20 6b 41 45 41 6e 79 29 |Index ==| kAEAny)|
|00001b40| 20 7b 0d 09 09 09 09 69 | 66 20 28 6e 75 6d 57 69 | {.....i|f (numWi|
|00001b50| 6e 64 6f 77 73 20 3c 3d | 20 31 29 09 09 2f 2a 20 |ndows <=| 1)../* |
|00001b60| 20 30 20 6f 72 20 31 20 | 77 69 6e 64 6f 77 73 20 | 0 or 1 |windows |
|00001b70| 2a 2f 0d 09 09 09 09 09 | 72 61 77 49 6e 64 65 78 |*/......|rawIndex|
|00001b80| 20 3d 20 6e 75 6d 57 69 | 6e 64 6f 77 73 3b 0d 09 | = numWi|ndows;..|
|00001b90| 09 09 09 65 6c 73 65 0d | 09 09 09 09 09 2f 2a 20 |...else.|...../* |
|00001ba0| 47 65 74 20 61 20 72 61 | 6e 64 6f 6d 20 6e 75 6d |Get a ra|ndom num|
|00001bb0| 62 65 72 20 62 65 74 77 | 65 65 6e 20 31 20 61 6e |ber betw|een 1 an|
|00001bc0| 64 20 6e 75 6d 57 69 6e | 64 6f 77 73 20 2a 2f 0d |d numWin|dows */.|
|00001bd0| 09 09 09 09 09 72 61 77 | 49 6e 64 65 78 20 3d 20 |.....raw|Index = |
|00001be0| 31 20 2b 20 28 28 75 6e | 73 69 67 6e 65 64 20 6c |1 + ((un|signed l|
|00001bf0| 6f 6e 67 29 52 61 6e 64 | 6f 6d 28 29 20 2a 20 28 |ong)Rand|om() * (|
|00001c00| 6e 75 6d 57 69 6e 64 6f | 77 73 20 2d 20 31 29 29 |numWindo|ws - 1))|
|00001c10| 20 3e 3e 20 31 36 3b 0d | 09 09 09 09 7d 0d 09 09 | >> 16;.|....}...|
|00001c20| 09 65 6c 73 65 20 69 66 | 20 28 72 61 77 49 6e 64 |.else if| (rawInd|
|00001c30| 65 78 20 3d 3d 20 6b 41 | 45 41 6c 6c 29 0d 09 09 |ex == kA|EAll)...|
|00001c40| 09 09 2a 67 65 74 41 6c | 6c 20 3d 20 54 52 55 45 |..*getAl|l = TRUE|
|00001c50| 3b 0d 09 09 62 72 65 61 | 6b 3b 0d 09 09 0d 09 09 |;...brea|k;......|
|00001c60| 63 61 73 65 20 74 79 70 | 65 49 6e 64 65 78 44 65 |case typ|eIndexDe|
|00001c70| 73 63 72 69 70 74 6f 72 | 3a 0d 09 09 09 2f 2a 20 |scriptor|:..../* |
|00001c80| 20 54 68 65 20 70 72 6f | 70 65 72 20 6e 75 6d 62 | The pro|per numb|
|00001c90| 65 72 20 69 73 20 61 6c | 72 65 61 64 79 20 69 6e |er is al|ready in|
|00001ca0| 20 22 72 61 77 49 6e 64 | 65 78 22 20 2a 2f 0d 09 | "rawInd|ex" */..|
|00001cb0| 09 62 72 65 61 6b 3b 0d | 09 7d 0d 09 0d 09 2f 2a |.break;.|.}..../*|
|00001cc0| 20 4d 61 6b 65 20 73 75 | 72 65 20 74 68 65 20 72 | Make su|re the r|
|00001cd0| 65 74 75 72 6e 65 64 20 | 76 61 6c 75 65 20 69 73 |eturned |value is|
|00001ce0| 20 69 6e 20 72 61 6e 67 | 65 20 2a 2f 0d 09 2a 69 | in rang|e */..*i|
|00001cf0| 6e 64 65 78 20 3d 20 28 | 72 61 77 49 6e 64 65 78 |ndex = (|rawIndex|
|00001d00| 20 3c 20 31 29 20 3f 20 | 31 3a 20 72 61 77 49 6e | < 1) ? |1: rawIn|
|00001d10| 64 65 78 3b 09 2f 2a 20 | 20 49 66 20 72 61 77 49 |dex;./* | If rawI|
|00001d20| 6e 64 65 78 20 69 73 20 | 30 20 6f 72 20 6e 65 67 |ndex is |0 or neg|
|00001d30| 61 74 69 76 65 2c 20 72 | 65 74 75 72 6e 20 31 20 |ative, r|eturn 1 |
|00001d40| 20 2a 2f 0d 09 69 66 20 | 28 72 61 77 49 6e 64 65 | */..if |(rawInde|
|00001d50| 78 20 3e 20 6e 75 6d 57 | 69 6e 64 6f 77 73 29 09 |x > numW|indows).|
|00001d60| 09 09 09 2f 2a 20 20 4d | 61 6b 65 20 73 75 72 65 |.../* M|ake sure|
|00001d70| 20 69 74 27 73 20 6e 6f | 74 20 74 6f 6f 20 6c 61 | it's no|t too la|
|00001d80| 72 67 65 20 65 69 74 68 | 65 72 20 2a 2f 0d 09 09 |rge eith|er */...|
|00001d90| 72 65 74 75 72 6e 20 65 | 72 72 41 45 4e 6f 53 75 |return e|rrAENoSu|
|00001da0| 63 68 4f 62 6a 65 63 74 | 3b 0d 09 65 6c 73 65 0d |chObject|;..else.|
|00001db0| 09 09 72 65 74 75 72 6e | 20 6e 6f 45 72 72 3b 0d |..return| noErr;.|
|00001dc0| 7d 20 2f 2a 20 57 69 6e | 5f 43 6f 6e 76 65 72 74 |} /* Win|_Convert|
|00001dd0| 41 62 73 4b 65 79 20 2a | 2f 0d 0d 0d 76 6f 69 64 |AbsKey *|/...void|
|00001de0| 20 42 75 69 6c 64 57 69 | 6e 64 6f 77 54 6f 6b 65 | BuildWi|ndowToke|
|00001df0| 6e 28 63 6f 6e 73 74 20 | 57 69 6e 64 6f 77 50 74 |n(const |WindowPt|
|00001e00| 72 20 74 68 65 57 69 6e | 64 6f 77 2c 20 44 65 73 |r theWin|dow, Des|
|00001e10| 63 54 79 70 65 20 64 65 | 73 69 72 65 64 43 6c 61 |cType de|siredCla|
|00001e20| 73 73 2c 20 6c 6f 6e 67 | 20 69 6e 64 65 78 2c 20 |ss, long| index, |
|00001e30| 41 45 44 65 73 63 20 2a | 74 68 65 54 6f 6b 65 6e |AEDesc *|theToken|
|00001e40| 29 0d 7b 0d 09 41 45 44 | 65 73 63 09 6e 75 6c 6c |).{..AED|esc.null|
|00001e50| 43 6f 6e 74 61 69 6e 65 | 72 20 3d 20 7b 27 6e 75 |Containe|r = {'nu|
|00001e60| 6c 6c 27 2c 20 4e 55 4c | 4c 7d 3b 0d 09 77 69 48 |ll', NUL|L};..wiH|
|00001e70| 61 6e 64 09 69 6e 66 6f | 20 3d 20 28 77 69 48 61 |and.info| = (wiHa|
|00001e80| 6e 64 29 47 65 74 57 52 | 65 66 43 6f 6e 28 74 68 |nd)GetWR|efCon(th|
|00001e90| 65 57 69 6e 64 6f 77 29 | 3b 0d 09 0d 09 74 68 65 |eWindow)|;....the|
|00001ea0| 54 6f 6b 65 6e 2d 3e 64 | 65 73 63 72 69 70 74 6f |Token->d|escripto|
|00001eb0| 72 54 79 70 65 20 3d 20 | 64 65 73 69 72 65 64 43 |rType = |desiredC|
|00001ec0| 6c 61 73 73 3b 0d 09 74 | 68 65 54 6f 6b 65 6e 2d |lass;..t|heToken-|
|00001ed0| 3e 64 61 74 61 48 61 6e | 64 6c 65 20 3d 20 4e 65 |>dataHan|dle = Ne|
|00001ee0| 77 48 61 6e 64 6c 65 43 | 6c 65 61 72 28 73 69 7a |wHandleC|lear(siz|
|00001ef0| 65 6f 66 28 6f 75 72 54 | 6f 6b 65 6e 29 29 3b 0d |eof(ourT|oken));.|
|00001f00| 09 74 6f 6b 65 6e 44 69 | 73 70 61 74 63 68 43 6c |.tokenDi|spatchCl|
|00001f10| 61 73 73 28 2a 74 68 65 | 54 6f 6b 65 6e 29 20 3d |ass(*the|Token) =|
|00001f20| 20 64 65 73 69 72 65 64 | 43 6c 61 73 73 3b 0d 09 | desired|Class;..|
|00001f30| 74 6f 6b 65 6e 46 6c 61 | 67 73 28 2a 74 68 65 54 |tokenFla|gs(*theT|
|00001f40| 6f 6b 65 6e 29 20 3d 20 | 6b 4f 62 6a 65 63 74 54 |oken) = |kObjectT|
|00001f50| 6f 6b 65 6e 3b 0d 09 74 | 6f 6b 65 6e 4f 62 6a 65 |oken;..t|okenObje|
|00001f60| 63 74 49 6e 64 65 78 28 | 2a 74 68 65 54 6f 6b 65 |ctIndex(|*theToke|
|00001f70| 6e 29 20 3d 20 69 6e 64 | 65 78 3b 0d 09 74 6f 6b |n) = ind|ex;..tok|
|00001f80| 65 6e 57 69 6e 64 6f 77 | 28 2a 74 68 65 54 6f 6b |enWindow|(*theTok|
|00001f90| 65 6e 29 20 3d 20 74 68 | 65 57 69 6e 64 6f 77 3b |en) = th|eWindow;|
|00001fa0| 0d 09 74 6f 6b 65 6e 46 | 52 65 66 4e 75 6d 28 2a |..tokenF|RefNum(*|
|00001fb0| 74 68 65 54 6f 6b 65 6e | 29 20 3d 20 28 2a 69 6e |theToken|) = (*in|
|00001fc0| 66 6f 29 2d 3e 66 52 65 | 66 4e 75 6d 3b 0d 09 0d |fo)->fRe|fNum;...|
|00001fd0| 7d 0d 0d 0d 2f 2a 20 54 | 6f 6b 65 6e 20 72 65 73 |}.../* T|oken res|
|00001fe0| 6f 6c 76 65 72 73 20 2d | 2d 20 72 65 61 64 2c 20 |olvers -|- read, |
|00001ff0| 77 72 69 74 65 2c 20 69 | 6e 73 65 72 74 2c 20 64 |write, i|nsert, d|
|00002000| 65 6c 65 74 65 20 2a 2f | 0d 0d 2f 2a 20 49 6e 64 |elete */|../* Ind|
|00002010| 69 76 69 64 75 61 6c 20 | 65 76 65 6e 74 20 68 61 |ividual |event ha|
|00002020| 6e 64 6c 65 72 73 20 2a | 2f 0d 0d 4f 53 45 72 72 |ndlers *|/..OSErr|
|00002030| 20 57 69 6e 5f 43 72 65 | 61 74 65 45 6c 65 6d 65 | Win_Cre|ateEleme|
|00002040| 6e 74 28 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 6d |nt(Apple|Event *m|
|00002050| 65 73 73 61 67 65 2c 20 | 41 70 70 6c 65 45 76 65 |essage, |AppleEve|
|00002060| 6e 74 20 2a 72 65 70 6c | 79 2c 20 44 65 73 63 54 |nt *repl|y, DescT|
|00002070| 79 70 65 20 69 6e 73 65 | 72 74 69 6f 6e 50 6f 73 |ype inse|rtionPos|
|00002080| 2c 20 2f 2a 20 3c 2d 20 | 74 68 69 73 20 69 73 20 |, /* <- |this is |
|00002090| 6e 6f 72 6d 61 6c 6c 79 | 20 74 68 65 20 72 65 66 |normally| the ref|
|000020a0| 43 6f 6e 20 2a 2f 0d 09 | 09 09 09 09 20 41 45 44 |Con */..|.... AED|
|000020b0| 65 73 63 20 2a 74 6f 6b | 65 6e 2c 20 41 45 44 65 |esc *tok|en, AEDe|
|000020c0| 73 63 20 2a 72 65 70 6c | 79 4f 62 6a 65 63 74 29 |sc *repl|yObject)|
|000020d0| 0d 7b 0d 09 4f 53 45 72 | 72 09 09 65 72 72 09 09 |.{..OSEr|r..err..|
|000020e0| 09 20 20 3d 20 6e 6f 45 | 72 72 3b 0d 09 41 45 44 |. = noE|rr;..AED|
|000020f0| 65 73 63 09 09 6e 75 6c | 6c 43 6f 6e 74 61 69 6e |esc..nul|lContain|
|00002100| 65 72 20 3d 20 7b 27 6e | 75 6c 6c 27 2c 20 30 4c |er = {'n|ull', 0L|
|00002110| 7d 3b 0d 09 41 45 44 65 | 73 63 09 09 6b 65 79 44 |};..AEDe|sc..keyD|
|00002120| 61 74 61 09 09 20 20 3d | 20 7b 27 6e 75 6c 6c 27 |ata.. =| {'null'|
|00002130| 2c 20 30 4c 7d 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |, 0L};..|WindowPt|
|00002140| 72 09 62 65 68 69 6e 64 | 57 69 6e 64 6f 77 3b 0d |r.behind|Window;.|
|00002150| 09 6c 6f 6e 67 09 09 69 | 6e 64 65 78 3b 0d 09 57 |.long..i|ndex;..W|
|00002160| 69 6e 64 6f 77 50 74 72 | 09 64 6f 63 5f 77 69 6e |indowPtr|.doc_win|
|00002170| 64 09 20 20 3d 20 30 4c | 3b 0d 09 0d 09 2f 2a 20 |d. = 0L|;..../* |
|00002180| 57 65 27 76 65 20 62 65 | 65 6e 20 61 73 6b 65 64 |We've be|en asked|
|00002190| 20 66 6f 72 20 61 20 6e | 65 77 20 77 69 6e 64 6f | for a n|ew windo|
|000021a0| 77 20 6f 72 20 64 6f 63 | 75 6d 65 6e 74 2e 20 53 |w or doc|ument. S|
|000021b0| 6f 20 63 72 65 61 74 65 | 20 6f 6e 65 20 69 6e 20 |o create| one in |
|000021c0| 74 68 65 20 2a 2f 0d 09 | 2f 2a 20 61 70 70 72 6f |the */..|/* appro|
|000021d0| 70 72 69 61 74 65 20 6c | 61 79 65 72 20 6f 6e 20 |priate l|ayer on |
|000021e0| 74 68 65 20 73 63 72 65 | 65 6e 20 2a 2f 0d 09 73 |the scre|en */..s|
|000021f0| 77 69 74 63 68 20 28 69 | 6e 73 65 72 74 69 6f 6e |witch (i|nsertion|
|00002200| 50 6f 73 29 20 7b 0d 09 | 09 63 61 73 65 20 6b 41 |Pos) {..|.case kA|
|00002210| 45 42 65 67 69 6e 6e 69 | 6e 67 3a 0d 09 09 09 62 |EBeginni|ng:....b|
|00002220| 65 68 69 6e 64 57 69 6e | 64 6f 77 20 3d 20 28 57 |ehindWin|dow = (W|
|00002230| 69 6e 64 6f 77 50 74 72 | 29 2d 31 4c 3b 0d 09 09 |indowPtr|)-1L;...|
|00002240| 09 69 6e 64 65 78 20 3d | 20 31 3b 0d 09 09 62 72 |.index =| 1;...br|
|00002250| 65 61 6b 3b 0d 09 0d 09 | 09 63 61 73 65 20 6b 41 |eak;....|.case kA|
|00002260| 45 45 6e 64 3a 0d 09 09 | 09 62 65 68 69 6e 64 57 |EEnd:...|.behindW|
|00002270| 69 6e 64 6f 77 20 3d 20 | 4e 55 4c 4c 3b 0d 09 09 |indow = |NULL;...|
|00002280| 09 69 6e 64 65 78 20 3d | 20 43 6f 75 6e 74 57 69 |.index =| CountWi|
|00002290| 6e 64 6f 77 73 28 29 3b | 0d 09 09 62 72 65 61 6b |ndows();|...break|
|000022a0| 3b 0d 09 09 0d 09 09 63 | 61 73 65 20 6b 41 45 42 |;......c|ase kAEB|
|000022b0| 65 66 6f 72 65 3a 0d 09 | 09 09 69 66 20 28 74 6f |efore:..|..if (to|
|000022c0| 6b 65 6e 2d 3e 64 61 74 | 61 48 61 6e 64 6c 65 20 |ken->dat|aHandle |
|000022d0| 3d 3d 20 4e 55 4c 4c 29 | 0d 09 09 09 09 72 65 74 |== NULL)|.....ret|
|000022e0| 75 72 6e 20 65 72 72 41 | 45 54 79 70 65 45 72 72 |urn errA|ETypeErr|
|000022f0| 6f 72 3b 0d 09 09 09 69 | 6e 64 65 78 20 3d 20 74 |or;....i|ndex = t|
|00002300| 6f 6b 65 6e 4f 62 6a 65 | 63 74 49 6e 64 65 78 28 |okenObje|ctIndex(|
|00002310| 2a 74 6f 6b 65 6e 29 3b | 0d 09 09 09 62 65 68 69 |*token);|....behi|
|00002320| 6e 64 57 69 6e 64 6f 77 | 20 3d 20 46 69 6e 64 49 |ndWindow| = FindI|
|00002330| 6e 64 65 78 65 64 57 69 | 6e 64 6f 77 28 69 6e 64 |ndexedWi|ndow(ind|
|00002340| 65 78 20 2d 20 31 29 3b | 0d 09 09 62 72 65 61 6b |ex - 1);|...break|
|00002350| 3b 0d 09 09 0d 09 09 63 | 61 73 65 20 6b 41 45 41 |;......c|ase kAEA|
|00002360| 66 74 65 72 3a 0d 09 09 | 09 69 66 20 28 74 6f 6b |fter:...|.if (tok|
|00002370| 65 6e 2d 3e 64 61 74 61 | 48 61 6e 64 6c 65 20 3d |en->data|Handle =|
|00002380| 3d 20 4e 55 4c 4c 29 0d | 09 09 09 09 72 65 74 75 |= NULL).|....retu|
|00002390| 72 6e 20 65 72 72 41 45 | 54 79 70 65 45 72 72 6f |rn errAE|TypeErro|
|000023a0| 72 3b 0d 09 09 09 69 6e | 64 65 78 20 3d 20 74 6f |r;....in|dex = to|
|000023b0| 6b 65 6e 4f 62 6a 65 63 | 74 49 6e 64 65 78 28 2a |kenObjec|tIndex(*|
|000023c0| 74 6f 6b 65 6e 29 20 2b | 20 31 3b 0d 09 09 09 62 |token) +| 1;....b|
|000023d0| 65 68 69 6e 64 57 69 6e | 64 6f 77 20 3d 20 46 69 |ehindWin|dow = Fi|
|000023e0| 6e 64 49 6e 64 65 78 65 | 64 57 69 6e 64 6f 77 28 |ndIndexe|dWindow(|
|000023f0| 69 6e 64 65 78 29 3b 0d | 09 09 62 72 65 61 6b 3b |index);.|..break;|
|00002400| 0d 09 09 0d 09 09 63 61 | 73 65 20 6b 41 45 52 65 |......ca|se kAERe|
|00002410| 70 6c 61 63 65 3a 0d 09 | 09 64 65 66 61 75 6c 74 |place:..|.default|
|00002420| 3a 0d 09 09 09 72 65 74 | 75 72 6e 20 65 72 72 41 |:....ret|urn errA|
|00002430| 45 45 76 65 6e 74 46 61 | 69 6c 65 64 3b 09 2f 2a |EEventFa|iled;./*|
|00002440| 20 20 57 65 20 77 6f 6e | 27 74 20 61 6c 6c 6f 77 | We won|'t allow|
|00002450| 20 61 20 6e 65 77 20 77 | 69 6e 64 6f 77 20 74 6f | a new w|indow to|
|00002460| 20 72 65 70 6c 61 63 65 | 20 61 6e 20 65 78 69 73 | replace| an exis|
|00002470| 74 69 6e 67 20 6f 6e 65 | 20 2a 2f 0d 09 7d 0d 09 |ting one| */..}..|
|00002480| 0d 09 4e 65 77 44 69 73 | 70 6c 61 79 57 69 6e 64 |..NewDis|playWind|
|00002490| 6f 77 28 4e 55 4c 4c 29 | 3b 20 2f 2f 20 3c 3c 3c |ow(NULL)|; // <<<|
|000024a0| 20 50 6f 74 65 6e 74 69 | 61 6c 20 61 64 64 69 74 | Potenti|al addit|
|000024b0| 69 6f 6e 3a 20 67 65 74 | 20 61 20 66 69 6c 65 20 |ion: get| a file |
|000024c0| 61 6c 69 61 73 20 66 72 | 6f 6d 20 74 68 65 20 22 |alias fr|om the "|
|000024d0| 64 61 74 61 22 20 70 61 | 72 61 6d 65 74 65 72 0d |data" pa|rameter.|
|000024e0| 09 64 6f 63 5f 77 69 6e | 64 20 3d 20 46 72 6f 6e |.doc_win|d = Fron|
|000024f0| 74 57 69 6e 64 6f 77 28 | 29 3b 0d 09 69 66 20 28 |tWindow(|);..if (|
|00002500| 20 49 73 56 61 6c 69 64 | 50 6f 69 6e 74 65 72 20 | IsValid|Pointer |
|00002510| 28 20 64 6f 63 5f 77 69 | 6e 64 20 29 20 29 0d 09 |( doc_wi|nd ) )..|
|00002520| 09 41 45 43 72 65 61 74 | 65 44 65 73 63 28 74 79 |.AECreat|eDesc(ty|
|00002530| 70 65 49 6e 64 65 78 44 | 65 73 63 72 69 70 74 6f |peIndexD|escripto|
|00002540| 72 2c 20 28 50 74 72 29 | 26 69 6e 64 65 78 2c 20 |r, (Ptr)|&index, |
|00002550| 73 69 7a 65 6f 66 28 69 | 6e 64 65 78 29 2c 20 26 |sizeof(i|ndex), &|
|00002560| 6b 65 79 44 61 74 61 29 | 3b 0d 09 65 6c 73 65 0d |keyData)|;..else.|
|00002570| 09 09 65 72 72 20 3d 20 | 4d 65 6d 45 72 72 6f 72 |..err = |MemError|
|00002580| 28 29 3b 0d 0d 09 69 66 | 20 28 6b 65 79 44 61 74 |();...if| (keyDat|
|00002590| 61 2e 64 61 74 61 48 61 | 6e 64 6c 65 20 21 3d 20 |a.dataHa|ndle != |
|000025a0| 30 4c 29 20 7b 0d 09 09 | 2f 2a 20 50 61 63 6b 61 |0L) {...|/* Packa|
|000025b0| 67 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 75 70 |ge every|thing up|
|000025c0| 20 69 6e 74 6f 20 61 6e | 20 6f 62 6a 65 63 74 20 | into an| object |
|000025d0| 73 70 65 63 69 66 69 65 | 72 2e 20 20 2a 2f 0d 09 |specifie|r. */..|
|000025e0| 09 65 72 72 20 3d 20 43 | 72 65 61 74 65 4f 62 6a |.err = C|reateObj|
|000025f0| 53 70 65 63 69 66 69 65 | 72 28 63 57 69 6e 64 6f |Specifie|r(cWindo|
|00002600| 77 2c 20 26 6e 75 6c 6c | 43 6f 6e 74 61 69 6e 65 |w, &null|Containe|
|00002610| 72 2c 20 66 6f 72 6d 41 | 62 73 6f 6c 75 74 65 50 |r, formA|bsoluteP|
|00002620| 6f 73 69 74 69 6f 6e 2c | 20 26 6b 65 79 44 61 74 |osition,| &keyDat|
|00002630| 61 2c 20 74 72 75 65 2c | 20 72 65 70 6c 79 4f 62 |a, true,| replyOb|
|00002640| 6a 65 63 74 29 3b 0d 09 | 7d 0d 09 72 65 74 75 72 |ject);..|}..retur|
|00002650| 6e 20 65 72 72 3b 0d 7d | 20 2f 2a 20 57 69 6e 5f |n err;.}| /* Win_|
|00002660| 43 72 65 61 74 65 45 6c | 65 6d 65 6e 74 20 2a 2f |CreateEl|ement */|
|00002670| 0d 0d 0d 4f 53 45 72 72 | 20 57 69 6e 5f 47 65 74 |...OSErr| Win_Get|
|00002680| 44 61 74 61 28 41 70 70 | 6c 65 45 76 65 6e 74 20 |Data(App|leEvent |
|00002690| 2a 6d 65 73 73 61 67 65 | 2c 20 41 70 70 6c 65 45 |*message|, AppleE|
|000026a0| 76 65 6e 74 20 2a 72 65 | 70 6c 79 2c 20 6c 6f 6e |vent *re|ply, lon|
|000026b0| 67 20 72 65 66 63 6f 6e | 2c 0d 09 09 09 09 41 45 |g refcon|,.....AE|
|000026c0| 44 65 73 63 20 2a 74 6f | 6b 65 6e 2c 20 41 45 44 |Desc *to|ken, AED|
|000026d0| 65 73 63 20 2a 72 65 70 | 6c 79 4f 62 6a 65 63 74 |esc *rep|lyObject|
|000026e0| 29 0d 7b 0d 09 72 65 74 | 75 72 6e 20 57 69 6e 5f |).{..ret|urn Win_|
|000026f0| 52 65 61 64 54 6f 6b 65 | 6e 44 61 74 61 28 74 6f |ReadToke|nData(to|
|00002700| 6b 65 6e 2c 20 72 65 70 | 6c 79 4f 62 6a 65 63 74 |ken, rep|lyObject|
|00002710| 29 3b 0d 7d 20 2f 2a 20 | 57 69 6e 5f 47 65 74 44 |);.} /* |Win_GetD|
|00002720| 61 74 61 20 2a 2f 0d 0d | 0d 4f 53 45 72 72 20 57 |ata */..|.OSErr W|
|00002730| 69 6e 5f 53 65 74 44 61 | 74 61 28 41 70 70 6c 65 |in_SetDa|ta(Apple|
|00002740| 45 76 65 6e 74 20 2a 6d | 65 73 73 61 67 65 2c 20 |Event *m|essage, |
|00002750| 41 70 70 6c 65 45 76 65 | 6e 74 20 2a 72 65 70 6c |AppleEve|nt *repl|
|00002760| 79 2c 20 6c 6f 6e 67 20 | 72 65 66 63 6f 6e 2c 0d |y, long |refcon,.|
|00002770| 09 09 09 09 41 45 44 65 | 73 63 20 2a 74 6f 6b 65 |....AEDe|sc *toke|
|00002780| 6e 2c 20 41 45 44 65 73 | 63 20 2a 72 65 70 6c 79 |n, AEDes|c *reply|
|00002790| 4f 62 6a 65 63 74 29 0d | 7b 0d 09 41 45 44 65 73 |Object).|{..AEDes|
|000027a0| 63 09 74 68 65 44 61 74 | 61 3b 0d 09 4f 53 45 72 |c.theDat|a;..OSEr|
|000027b0| 72 09 65 72 72 3b 0d 0d | 09 65 72 72 20 3d 20 41 |r.err;..|.err = A|
|000027c0| 45 47 65 74 4b 65 79 44 | 65 73 63 28 6d 65 73 73 |EGetKeyD|esc(mess|
|000027d0| 61 67 65 2c 20 6b 65 79 | 41 45 44 61 74 61 2c 20 |age, key|AEData, |
|000027e0| 74 79 70 65 57 69 6c 64 | 43 61 72 64 2c 20 26 74 |typeWild|Card, &t|
|000027f0| 68 65 44 61 74 61 29 3b | 0d 09 69 66 20 28 65 72 |heData);|..if (er|
|00002800| 72 20 3d 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |r == noE|rr) {...|
|00002810| 2f 2a 20 57 65 20 64 6f | 6e 27 74 20 68 61 6e 64 |/* We do|n't hand|
|00002820| 6c 65 20 70 61 73 73 69 | 6e 67 20 69 6e 20 74 68 |le passi|ng in th|
|00002830| 65 20 64 61 74 61 20 61 | 73 20 61 6e 20 6f 62 6a |e data a|s an obj|
|00002840| 65 63 74 20 73 70 65 63 | 69 66 69 65 72 20 79 65 |ect spec|ifier ye|
|00002850| 74 20 2a 2f 0d 09 09 69 | 66 20 28 74 68 65 44 61 |t */...i|f (theDa|
|00002860| 74 61 2e 64 65 73 63 72 | 69 70 74 6f 72 54 79 70 |ta.descr|iptorTyp|
|00002870| 65 20 3d 20 74 79 70 65 | 4f 62 6a 65 63 74 53 70 |e = type|ObjectSp|
|00002880| 65 63 69 66 69 65 72 29 | 20 7b 0d 09 09 09 72 65 |ecifier)| {....re|
|00002890| 74 75 72 6e 20 65 72 72 | 41 45 43 61 6e 74 48 61 |turn err|AECantHa|
|000028a0| 6e 64 6c 65 43 6c 61 73 | 73 3b 0d 09 09 7d 0d 09 |ndleClas|s;...}..|
|000028b0| 09 65 72 72 20 3d 20 57 | 69 6e 5f 57 72 69 74 65 |.err = W|in_Write|
|000028c0| 54 6f 6b 65 6e 44 61 74 | 61 28 74 6f 6b 65 6e 2c |TokenDat|a(token,|
|000028d0| 20 26 74 68 65 44 61 74 | 61 29 3b 0d 09 09 28 76 | &theDat|a);...(v|
|000028e0| 6f 69 64 29 41 45 44 69 | 73 70 6f 73 65 44 65 73 |oid)AEDi|sposeDes|
|000028f0| 63 28 26 74 68 65 44 61 | 74 61 29 3b 0d 09 7d 0d |c(&theDa|ta);..}.|
|00002900| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 7d 20 2f |.return |err;.} /|
|00002910| 2a 20 57 69 6e 5f 53 65 | 74 44 61 74 61 20 2a 2f |* Win_Se|tData */|
|00002920| 0d 0d 0d 4f 53 45 72 72 | 20 57 69 6e 5f 43 6c 6f |...OSErr| Win_Clo|
|00002930| 73 65 28 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 6d |se(Apple|Event *m|
|00002940| 65 73 73 61 67 65 2c 20 | 41 70 70 6c 65 45 76 65 |essage, |AppleEve|
|00002950| 6e 74 20 2a 72 65 70 6c | 79 2c 20 6c 6f 6e 67 20 |nt *repl|y, long |
|00002960| 72 65 66 63 6f 6e 2c 0d | 09 09 09 09 41 45 44 65 |refcon,.|....AEDe|
|00002970| 73 63 20 2a 74 6f 6b 65 | 6e 2c 20 41 45 44 65 73 |sc *toke|n, AEDes|
|00002980| 63 20 2a 72 65 70 6c 79 | 4f 62 6a 65 63 74 29 0d |c *reply|Object).|
|00002990| 7b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 74 68 65 |{..Windo|wPtr.the|
|000029a0| 57 69 6e 64 6f 77 20 3d | 20 74 6f 6b 65 6e 57 69 |Window =| tokenWi|
|000029b0| 6e 64 6f 77 28 2a 74 6f | 6b 65 6e 29 3b 0d 0d 09 |ndow(*to|ken);...|
|000029c0| 43 6c 6f 73 65 41 57 69 | 6e 64 6f 77 28 74 68 65 |CloseAWi|ndow(the|
|000029d0| 57 69 6e 64 6f 77 29 3b | 0d 09 72 65 74 75 72 6e |Window);|..return|
|000029e0| 20 6e 6f 45 72 72 3b 0d | 0d 7d 20 2f 2a 20 57 69 | noErr;.|.} /* Wi|
|000029f0| 6e 5f 43 6c 6f 73 65 20 | 2a 2f 0d 0d 0d 4f 53 45 |n_Close |*/...OSE|
|00002a00| 72 72 20 57 69 6e 5f 52 | 65 61 64 54 6f 6b 65 6e |rr Win_R|eadToken|
|00002a10| 44 61 74 61 28 63 6f 6e | 73 74 20 41 45 44 65 73 |Data(con|st AEDes|
|00002a20| 63 20 2a 74 68 65 54 6f | 6b 65 6e 2c 20 41 45 44 |c *theTo|ken, AED|
|00002a30| 65 73 63 20 2a 74 6f 6b | 65 6e 43 6f 6e 74 65 6e |esc *tok|enConten|
|00002a40| 74 73 29 0d 7b 0d 09 44 | 65 73 63 54 79 70 65 09 |ts).{..D|escType.|
|00002a50| 73 63 72 61 74 63 68 54 | 79 70 65 3b 0d 09 42 6f |scratchT|ype;..Bo|
|00002a60| 6f 6c 65 61 6e 09 09 73 | 63 72 61 74 63 68 42 6f |olean..s|cratchBo|
|00002a70| 6f 6c 3b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 74 |ol;..Win|dowPtr.t|
|00002a80| 68 65 57 69 6e 64 6f 77 | 3b 0d 09 44 65 73 63 54 |heWindow|;..DescT|
|00002a90| 79 70 65 09 70 72 6f 70 | 43 6f 64 65 2c 0d 09 09 |ype.prop|Code,...|
|00002aa0| 09 09 6f 62 6a 43 6c 61 | 73 73 3b 0d 09 4f 53 45 |..objCla|ss;..OSE|
|00002ab0| 72 72 09 09 65 72 72 09 | 09 09 3d 20 6e 6f 45 72 |rr..err.|..= noEr|
|00002ac0| 72 3b 0d 09 41 45 44 65 | 73 63 09 09 6b 65 79 44 |r;..AEDe|sc..keyD|
|00002ad0| 61 74 61 2c 0d 09 09 09 | 09 6e 75 6c 6c 44 65 73 |ata,....|.nullDes|
|00002ae0| 63 09 3d 20 7b 27 6e 75 | 6c 6c 27 2c 20 4e 55 4c |c.= {'nu|ll', NUL|
|00002af0| 4c 7d 3b 0d 09 41 45 44 | 65 73 63 09 09 73 63 72 |L};..AED|esc..scr|
|00002b00| 61 74 63 68 44 65 73 63 | 3b 0d 09 6c 6f 6e 67 09 |atchDesc|;..long.|
|00002b10| 09 64 6f 63 75 6d 65 6e | 74 4e 75 6d 62 65 72 3b |.documen|tNumber;|
|00002b20| 0d 09 0d 09 2f 2a 20 20 | 47 65 74 20 74 68 65 20 |..../* |Get the |
|00002b30| 74 68 69 6e 67 20 70 6f | 69 6e 74 65 64 20 74 6f |thing po|inted to|
|00002b40| 20 62 79 20 61 20 70 72 | 6f 70 65 72 74 79 20 6f | by a pr|operty o|
|00002b50| 72 20 6f 62 6a 65 63 74 | 20 74 6f 6b 65 6e 20 2a |r object| token *|
|00002b60| 2f 0d 09 74 68 65 57 69 | 6e 64 6f 77 20 3d 20 74 |/..theWi|ndow = t|
|00002b70| 6f 6b 65 6e 57 69 6e 64 | 6f 77 28 2a 74 68 65 54 |okenWind|ow(*theT|
|00002b80| 6f 6b 65 6e 29 3b 0d 09 | 6f 62 6a 43 6c 61 73 73 |oken);..|objClass|
|00002b90| 20 3d 20 74 6f 6b 65 6e | 44 69 73 70 61 74 63 68 | = token|Dispatch|
|00002ba0| 43 6c 61 73 73 28 2a 74 | 68 65 54 6f 6b 65 6e 29 |Class(*t|heToken)|
|00002bb0| 3b 0d 09 69 66 20 28 74 | 6f 6b 65 6e 46 6c 61 67 |;..if (t|okenFlag|
|00002bc0| 73 28 2a 74 68 65 54 6f | 6b 65 6e 29 20 26 20 6b |s(*theTo|ken) & k|
|00002bd0| 50 72 6f 70 54 6f 6b 65 | 6e 29 20 7b 0d 09 09 2f |PropToke|n) {.../|
|00002be0| 2a 20 52 65 74 75 72 6e | 20 61 6e 79 20 72 65 61 |* Return| any rea|
|00002bf0| 64 61 62 6c 65 20 70 72 | 6f 70 65 72 74 69 65 73 |dable pr|operties|
|00002c00| 20 2a 2f 0d 09 09 70 72 | 6f 70 43 6f 64 65 20 3d | */...pr|opCode =|
|00002c10| 20 74 6f 6b 65 6e 50 72 | 6f 70 43 6f 64 65 28 2a | tokenPr|opCode(*|
|00002c20| 74 68 65 54 6f 6b 65 6e | 29 3b 0d 09 09 0d 09 09 |theToken|);......|
|00002c30| 73 77 69 74 63 68 20 28 | 70 72 6f 70 43 6f 64 65 |switch (|propCode|
|00002c40| 29 20 7b 0d 09 09 09 63 | 61 73 65 20 70 43 6c 61 |) {....c|ase pCla|
|00002c50| 73 73 3a 20 0d 09 09 09 | 09 72 65 74 75 72 6e 20 |ss: ....|.return |
|00002c60| 41 45 43 72 65 61 74 65 | 44 65 73 63 28 74 79 70 |AECreate|Desc(typ|
|00002c70| 65 54 79 70 65 2c 20 28 | 50 74 72 29 26 6f 62 6a |eType, (|Ptr)&obj|
|00002c80| 43 6c 61 73 73 2c 20 73 | 69 7a 65 6f 66 28 6f 62 |Class, s|izeof(ob|
|00002c90| 6a 43 6c 61 73 73 29 2c | 20 74 6f 6b 65 6e 43 6f |jClass),| tokenCo|
|00002ca0| 6e 74 65 6e 74 73 29 3b | 0d 09 09 09 62 72 65 61 |ntents);|....brea|
|00002cb0| 6b 3b 0d 09 09 09 0d 09 | 09 09 63 61 73 65 20 70 |k;......|..case p|
|00002cc0| 42 65 73 74 54 79 70 65 | 3a 0d 09 09 09 63 61 73 |BestType|:....cas|
|00002cd0| 65 20 70 44 65 66 61 75 | 6c 74 54 79 70 65 3a 0d |e pDefau|ltType:.|
|00002ce0| 09 09 09 09 73 63 72 61 | 74 63 68 54 79 70 65 20 |....scra|tchType |
|00002cf0| 3d 20 74 79 70 65 4f 62 | 6a 65 63 74 53 70 65 63 |= typeOb|jectSpec|
|00002d00| 69 66 69 65 72 3b 0d 09 | 09 09 09 72 65 74 75 72 |ifier;..|...retur|
|00002d10| 6e 20 41 45 43 72 65 61 | 74 65 44 65 73 63 28 74 |n AECrea|teDesc(t|
|00002d20| 79 70 65 54 79 70 65 2c | 20 28 50 74 72 29 26 73 |ypeType,| (Ptr)&s|
|00002d30| 63 72 61 74 63 68 54 79 | 70 65 2c 20 73 69 7a 65 |cratchTy|pe, size|
|00002d40| 6f 66 28 73 63 72 61 74 | 63 68 54 79 70 65 29 2c |of(scrat|chType),|
|00002d50| 20 74 6f 6b 65 6e 43 6f | 6e 74 65 6e 74 73 29 3b | tokenCo|ntents);|
|00002d60| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 0d 09 |....brea|k;......|
|00002d70| 09 09 63 61 73 65 20 70 | 48 61 73 54 69 74 6c 65 |..case p|HasTitle|
|00002d80| 42 61 72 3a 0d 09 09 09 | 09 2f 2a 20 20 59 65 73 |Bar:....|./* Yes|
|00002d90| 20 56 69 72 67 69 6e 69 | 61 2c 20 74 68 65 72 65 | Virgini|a, there|
|00002da0| 20 69 73 20 61 20 54 69 | 74 6c 65 20 42 61 72 20 | is a Ti|tle Bar |
|00002db0| 2a 2f 0d 09 09 09 09 73 | 63 72 61 74 63 68 42 6f |*/.....s|cratchBo|
|00002dc0| 6f 6c 20 3d 20 74 72 75 | 65 3b 0d 09 09 09 09 72 |ol = tru|e;.....r|
|00002dd0| 65 74 75 72 6e 20 41 45 | 43 72 65 61 74 65 44 65 |eturn AE|CreateDe|
|00002de0| 73 63 28 74 79 70 65 42 | 6f 6f 6c 65 61 6e 2c 20 |sc(typeB|oolean, |
|00002df0| 28 50 74 72 29 26 73 63 | 72 61 74 63 68 42 6f 6f |(Ptr)&sc|ratchBoo|
|00002e00| 6c 2c 20 73 69 7a 65 6f | 66 28 73 63 72 61 74 63 |l, sizeo|f(scratc|
|00002e10| 68 42 6f 6f 6c 29 2c 20 | 74 6f 6b 65 6e 43 6f 6e |hBool), |tokenCon|
|00002e20| 74 65 6e 74 73 29 3b 0d | 09 09 09 62 72 65 61 6b |tents);.|...break|
|00002e30| 3b 0d 09 09 09 0d 09 09 | 09 63 61 73 65 20 70 48 |;.......|.case pH|
|00002e40| 61 73 43 6c 6f 73 65 42 | 6f 78 3a 0d 09 09 09 63 |asCloseB|ox:....c|
|00002e50| 61 73 65 20 70 49 73 46 | 6c 6f 61 74 69 6e 67 3a |ase pIsF|loating:|
|00002e60| 0d 09 09 09 63 61 73 65 | 20 70 49 73 4d 6f 64 61 |....case| pIsModa|
|00002e70| 6c 3a 0d 09 09 09 63 61 | 73 65 20 70 49 73 52 65 |l:....ca|se pIsRe|
|00002e80| 73 69 7a 61 62 6c 65 3a | 0d 09 09 09 63 61 73 65 |sizable:|....case|
|00002e90| 20 70 49 73 5a 6f 6f 6d | 61 62 6c 65 3a 0d 09 09 | pIsZoom|able:...|
|00002ea0| 09 63 61 73 65 20 70 49 | 73 5a 6f 6f 6d 65 64 3a |.case pI|sZoomed:|
|00002eb0| 0d 09 09 09 09 2f 2a 20 | 20 4e 6f 6e 65 20 6f 66 |...../* | None of|
|00002ec0| 20 74 68 65 20 61 62 6f | 76 65 20 70 72 6f 70 65 | the abo|ve prope|
|00002ed0| 72 74 69 65 73 20 61 72 | 65 20 74 72 75 65 20 2a |rties ar|e true *|
|00002ee0| 2f 0d 09 09 09 09 73 63 | 72 61 74 63 68 42 6f 6f |/.....sc|ratchBoo|
|00002ef0| 6c 20 3d 20 66 61 6c 73 | 65 3b 0d 09 09 09 09 72 |l = fals|e;.....r|
|00002f00| 65 74 75 72 6e 20 41 45 | 43 72 65 61 74 65 44 65 |eturn AE|CreateDe|
|00002f10| 73 63 28 74 79 70 65 42 | 6f 6f 6c 65 61 6e 2c 20 |sc(typeB|oolean, |
|00002f20| 28 50 74 72 29 26 73 63 | 72 61 74 63 68 42 6f 6f |(Ptr)&sc|ratchBoo|
|00002f30| 6c 2c 20 73 69 7a 65 6f | 66 28 73 63 72 61 74 63 |l, sizeo|f(scratc|
|00002f40| 68 42 6f 6f 6c 29 2c 20 | 74 6f 6b 65 6e 43 6f 6e |hBool), |tokenCon|
|00002f50| 74 65 6e 74 73 29 3b 0d | 09 09 09 62 72 65 61 6b |tents);.|...break|
|00002f60| 3b 0d 09 09 09 0d 09 09 | 09 63 61 73 65 20 70 56 |;.......|.case pV|
|00002f70| 69 73 69 62 6c 65 3a 0d | 09 09 09 09 2f 2a 20 20 |isible:.|..../* |
|00002f80| 57 65 27 6c 6c 20 68 61 | 76 65 20 74 6f 20 63 68 |We'll ha|ve to ch|
|00002f90| 65 63 6b 20 74 68 65 20 | 77 69 6e 64 6f 77 c9 20 |eck the |window. |
|00002fa0| 2a 2f 0d 09 09 09 09 73 | 63 72 61 74 63 68 42 6f |*/.....s|cratchBo|
|00002fb0| 6f 6c 20 3d 20 28 28 57 | 69 6e 64 6f 77 50 65 65 |ol = ((W|indowPee|
|00002fc0| 6b 29 74 68 65 57 69 6e | 64 6f 77 29 2d 3e 76 69 |k)theWin|dow)->vi|
|00002fd0| 73 69 62 6c 65 3b 0d 09 | 09 09 09 72 65 74 75 72 |sible;..|...retur|
|00002fe0| 6e 20 41 45 43 72 65 61 | 74 65 44 65 73 63 28 74 |n AECrea|teDesc(t|
|00002ff0| 79 70 65 42 6f 6f 6c 65 | 61 6e 2c 20 28 50 74 72 |ypeBoole|an, (Ptr|
|00003000| 29 26 73 63 72 61 74 63 | 68 42 6f 6f 6c 2c 20 73 |)&scratc|hBool, s|
|00003010| 69 7a 65 6f 66 28 73 63 | 72 61 74 63 68 42 6f 6f |izeof(sc|ratchBoo|
|00003020| 6c 29 2c 20 74 6f 6b 65 | 6e 43 6f 6e 74 65 6e 74 |l), toke|nContent|
|00003030| 73 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |s);....b|reak;...|
|00003040| 09 0d 09 09 09 63 61 73 | 65 20 70 49 73 4d 6f 64 |.....cas|e pIsMod|
|00003050| 69 66 69 65 64 3a 0d 09 | 09 09 09 2f 2a 20 4f 75 |ified:..|.../* Ou|
|00003060| 72 20 66 69 6c 65 20 69 | 73 20 61 75 74 6f 6d 61 |r file i|s automa|
|00003070| 74 69 63 61 6c 6c 79 20 | 73 61 76 65 64 20 61 6e |tically |saved an|
|00003080| 79 20 74 69 6d 65 20 61 | 20 63 68 61 6e 67 65 20 |y time a| change |
|00003090| 69 73 20 6d 61 64 65 2c | 20 73 6f 20 74 68 69 73 |is made,| so this|
|000030a0| 20 69 73 20 2a 2f 0d 09 | 09 09 09 2f 2a 20 61 6c | is */..|.../* al|
|000030b0| 77 61 79 73 20 66 61 6c | 73 65 2e 20 2a 2f 0d 09 |ways fal|se. */..|
|000030c0| 09 09 09 73 63 72 61 74 | 63 68 42 6f 6f 6c 20 3d |...scrat|chBool =|
|000030d0| 20 66 61 6c 73 65 3b 0d | 09 09 09 09 72 65 74 75 | false;.|....retu|
|000030e0| 72 6e 20 41 45 43 72 65 | 61 74 65 44 65 73 63 28 |rn AECre|ateDesc(|
|000030f0| 74 79 70 65 42 6f 6f 6c | 65 61 6e 2c 20 28 50 74 |typeBool|ean, (Pt|
|00003100| 72 29 26 73 63 72 61 74 | 63 68 42 6f 6f 6c 2c 20 |r)&scrat|chBool, |
|00003110| 73 69 7a 65 6f 66 28 73 | 63 72 61 74 63 68 42 6f |sizeof(s|cratchBo|
|00003120| 6f 6c 29 2c 20 74 6f 6b | 65 6e 43 6f 6e 74 65 6e |ol), tok|enConten|
|00003130| 74 73 29 3b 0d 09 09 09 | 62 72 65 61 6b 3b 0d 09 |ts);....|break;..|
|00003140| 09 09 0d 09 09 09 63 61 | 73 65 20 70 4e 61 6d 65 |......ca|se pName|
|00003150| 3a 20 7b 0d 09 09 09 09 | 2f 2a 20 47 65 74 20 74 |: {.....|/* Get t|
|00003160| 68 65 20 74 69 74 6c 65 | 20 6f 66 20 74 68 65 20 |he title| of the |
|00003170| 73 65 6c 65 63 74 65 64 | 20 77 69 6e 64 6f 77 20 |selected| window |
|00003180| 61 6e 64 20 72 65 74 75 | 72 6e 20 74 68 61 74 20 |and retu|rn that |
|00003190| 2a 2f 0d 09 09 09 09 53 | 74 72 32 35 35 09 77 69 |*/.....S|tr255.wi|
|000031a0| 6e 64 6f 77 4e 61 6d 65 | 3b 0d 09 09 09 09 0d 09 |ndowName|;.......|
|000031b0| 09 09 09 47 65 74 57 54 | 69 74 6c 65 28 74 68 65 |...GetWT|itle(the|
|000031c0| 57 69 6e 64 6f 77 2c 20 | 77 69 6e 64 6f 77 4e 61 |Window, |windowNa|
|000031d0| 6d 65 29 3b 0d 09 09 09 | 09 72 65 74 75 72 6e 20 |me);....|.return |
|000031e0| 41 45 43 72 65 61 74 65 | 44 65 73 63 28 74 79 70 |AECreate|Desc(typ|
|000031f0| 65 43 68 61 72 2c 20 28 | 50 74 72 29 26 77 69 6e |eChar, (|Ptr)&win|
|00003200| 64 6f 77 4e 61 6d 65 5b | 31 5d 2c 20 2a 77 69 6e |dowName[|1], *win|
|00003210| 64 6f 77 4e 61 6d 65 2c | 20 74 6f 6b 65 6e 43 6f |dowName,| tokenCo|
|00003220| 6e 74 65 6e 74 73 29 3b | 0d 09 09 09 7d 20 62 72 |ntents);|....} br|
|00003230| 65 61 6b 3b 0d 09 09 09 | 0d 09 09 09 63 61 73 65 |eak;....|....case|
|00003240| 20 70 53 65 6c 65 63 74 | 69 6f 6e 3a 20 7b 0d 09 | pSelect|ion: {..|
|00003250| 09 09 09 2f 2a 20 49 66 | 20 77 65 20 68 61 76 65 |.../* If| we have|
|00003260| 20 61 20 63 75 72 72 65 | 6e 74 20 73 65 6c 65 63 | a curre|nt selec|
|00003270| 74 69 6f 6e 2c 20 72 65 | 74 75 72 6e 20 61 6e 20 |tion, re|turn an |
|00003280| 6f 62 6a 65 63 74 20 73 | 70 65 63 69 66 69 65 72 |object s|pecifier|
|00003290| 20 66 6f 72 20 69 74 2e | 20 2a 2f 0d 09 09 09 09 | for it.| */.....|
|000032a0| 2f 2a 20 4f 74 68 65 72 | 77 69 73 65 2c 20 72 65 |/* Other|wise, re|
|000032b0| 74 75 72 6e 20 6e 75 6c | 6c 20 2a 2f 0d 09 09 09 |turn nul|l */....|
|000032c0| 09 77 69 48 61 6e 64 09 | 69 6e 66 6f 20 3d 20 28 |.wiHand.|info = (|
|000032d0| 77 69 48 61 6e 64 29 47 | 65 74 57 52 65 66 43 6f |wiHand)G|etWRefCo|
|000032e0| 6e 28 74 68 65 57 69 6e | 64 6f 77 29 3b 0d 09 09 |n(theWin|dow);...|
|000032f0| 09 09 41 45 44 65 73 63 | 09 6e 75 6c 6c 43 6f 6e |..AEDesc|.nullCon|
|00003300| 74 61 69 6e 65 72 20 3d | 20 7b 74 79 70 65 4e 75 |tainer =| {typeNu|
|00003310| 6c 6c 2c 20 4e 55 4c 4c | 7d 3b 0d 09 09 09 09 41 |ll, NULL|};.....A|
|00003320| 45 44 65 73 63 09 6b 65 | 79 44 61 74 61 2c 20 64 |EDesc.ke|yData, d|
|00003330| 6f 63 43 6f 6e 74 61 69 | 6e 65 72 3b 0d 09 09 09 |ocContai|ner;....|
|00003340| 09 6c 6f 6e 67 09 69 6e | 64 65 78 3b 0d 09 09 09 |.long.in|dex;....|
|00003350| 09 0d 09 09 09 09 69 66 | 20 28 28 2a 69 6e 66 6f |......if| ((*info|
|00003360| 29 2d 3e 6e 75 6d 45 6e | 74 72 69 65 73 20 3d 3d |)->numEn|tries ==|
|00003370| 20 30 29 20 7b 0d 09 09 | 09 09 09 2f 2a 20 54 68 | 0) {...|.../* Th|
|00003380| 65 72 65 27 73 20 6e 6f | 20 73 65 6c 65 63 74 69 |ere's no| selecti|
|00003390| 6f 6e 2c 20 73 6f 20 72 | 65 74 75 72 6e 20 61 20 |on, so r|eturn a |
|000033a0| 6e 75 6c 6c 20 64 65 73 | 63 72 69 70 74 6f 72 20 |null des|criptor |
|000033b0| 2a 2f 0d 09 09 09 09 09 | 2a 74 6f 6b 65 6e 43 6f |*/......|*tokenCo|
|000033c0| 6e 74 65 6e 74 73 20 3d | 20 6e 75 6c 6c 43 6f 6e |ntents =| nullCon|
|000033d0| 74 61 69 6e 65 72 3b 0d | 09 09 09 09 7d 20 65 6c |tainer;.|....} el|
|000033e0| 73 65 20 7b 0d 09 09 09 | 09 09 2f 2a 20 52 65 74 |se {....|../* Ret|
|000033f0| 75 72 6e 20 61 6e 20 6f | 62 6a 65 63 74 20 73 70 |urn an o|bject sp|
|00003400| 65 63 69 66 69 65 72 20 | 66 6f 72 20 74 68 65 20 |ecifier |for the |
|00003410| 63 75 72 72 65 6e 74 6c | 79 20 76 69 73 69 62 6c |currentl|y visibl|
|00003420| 65 20 65 6e 74 72 79 20 | 2a 2f 0d 09 09 09 09 09 |e entry |*/......|
|00003430| 2f 2a 20 54 68 65 20 73 | 70 65 63 69 66 69 65 72 |/* The s|pecifier|
|00003440| 20 77 69 6c 6c 20 62 65 | 20 22 65 6e 74 72 79 20 | will be| "entry |
|00003450| 6e 20 6f 66 20 64 6f 63 | 75 6d 65 6e 74 20 6d 22 |n of doc|ument m"|
|00003460| 20 2a 2f 0d 09 09 09 09 | 09 69 6e 64 65 78 20 3d | */.....|.index =|
|00003470| 20 47 65 74 57 69 6e 64 | 6f 77 49 6e 64 65 78 28 | GetWind|owIndex(|
|00003480| 74 68 65 57 69 6e 64 6f | 77 29 3b 0d 09 09 09 09 |theWindo|w);.....|
|00003490| 09 65 72 72 20 3d 20 43 | 72 65 61 74 65 4f 66 66 |.err = C|reateOff|
|000034a0| 73 65 74 44 65 73 63 72 | 69 70 74 6f 72 28 69 6e |setDescr|iptor(in|
|000034b0| 64 65 78 2c 20 26 6b 65 | 79 44 61 74 61 29 3b 0d |dex, &ke|yData);.|
|000034c0| 09 09 09 09 09 69 66 20 | 28 65 72 72 20 21 3d 20 |.....if |(err != |
|000034d0| 6e 6f 45 72 72 29 20 72 | 65 74 75 72 6e 20 65 72 |noErr) r|eturn er|
|000034e0| 72 3b 0d 09 09 09 09 09 | 65 72 72 20 3d 20 43 72 |r;......|err = Cr|
|000034f0| 65 61 74 65 4f 62 6a 53 | 70 65 63 69 66 69 65 72 |eateObjS|pecifier|
|00003500| 28 63 44 6f 63 75 6d 65 | 6e 74 2c 20 26 6e 75 6c |(cDocume|nt, &nul|
|00003510| 6c 43 6f 6e 74 61 69 6e | 65 72 2c 20 66 6f 72 6d |lContain|er, form|
|00003520| 41 62 73 6f 6c 75 74 65 | 50 6f 73 69 74 69 6f 6e |Absolute|Position|
|00003530| 2c 20 26 6b 65 79 44 61 | 74 61 2c 20 74 72 75 65 |, &keyDa|ta, true|
|00003540| 2c 20 26 64 6f 63 43 6f | 6e 74 61 69 6e 65 72 29 |, &docCo|ntainer)|
|00003550| 3b 0d 09 09 09 09 09 2f | 2a 20 57 65 20 64 6f 6e |;....../|* We don|
|00003560| 27 74 20 68 61 76 65 20 | 74 6f 20 64 69 73 70 6f |'t have |to dispo|
|00003570| 73 65 20 6f 66 20 74 68 | 65 20 63 6f 6e 74 61 69 |se of th|e contai|
|00003580| 6e 65 72 20 6f 72 20 6b | 65 79 20 64 61 74 61 20 |ner or k|ey data |
|00003590| 62 65 63 61 75 73 65 20 | 43 72 65 61 74 65 4f 62 |because |CreateOb|
|000035a0| 6a 53 70 65 63 69 66 69 | 65 72 20 64 6f 65 73 20 |jSpecifi|er does |
|000035b0| 74 68 61 74 20 66 6f 72 | 20 75 73 20 2a 2f 0d 09 |that for| us */..|
|000035c0| 09 09 09 09 69 66 20 28 | 65 72 72 20 3d 3d 20 6e |....if (|err == n|
|000035d0| 6f 45 72 72 29 20 7b 0d | 09 09 09 09 09 09 2f 2a |oErr) {.|....../*|
|000035e0| 20 57 65 20 68 61 76 65 | 20 74 68 65 20 22 64 6f | We have| the "do|
|000035f0| 63 75 6d 65 6e 74 20 6d | 22 20 70 61 72 74 2c 20 |cument m|" part, |
|00003600| 6e 6f 77 20 63 6f 6d 70 | 6c 65 74 65 20 74 68 65 |now comp|lete the|
|00003610| 20 6f 62 6a 65 63 74 20 | 73 70 65 63 69 66 69 65 | object |specifie|
|00003620| 72 20 2a 2f 0d 09 09 09 | 09 09 09 69 6e 64 65 78 |r */....|...index|
|00003630| 20 3d 20 28 2a 69 6e 66 | 6f 29 2d 3e 63 75 72 72 | = (*inf|o)->curr|
|00003640| 45 6e 74 72 79 4e 75 6d | 3b 0d 09 09 09 09 09 09 |EntryNum|;.......|
|00003650| 65 72 72 20 3d 20 43 72 | 65 61 74 65 4f 66 66 73 |err = Cr|eateOffs|
|00003660| 65 74 44 65 73 63 72 69 | 70 74 6f 72 28 69 6e 64 |etDescri|ptor(ind|
|00003670| 65 78 2c 20 26 6b 65 79 | 44 61 74 61 29 3b 0d 09 |ex, &key|Data);..|
|00003680| 09 09 09 09 09 69 66 20 | 28 65 72 72 20 3d 3d 20 |.....if |(err == |
|00003690| 6e 6f 45 72 72 29 20 7b | 0d 09 09 09 09 09 09 09 |noErr) {|........|
|000036a0| 65 72 72 20 3d 20 43 72 | 65 61 74 65 4f 62 6a 53 |err = Cr|eateObjS|
|000036b0| 70 65 63 69 66 69 65 72 | 28 63 45 6e 74 72 79 2c |pecifier|(cEntry,|
|000036c0| 20 26 64 6f 63 43 6f 6e | 74 61 69 6e 65 72 2c 20 | &docCon|tainer, |
|000036d0| 66 6f 72 6d 41 62 73 6f | 6c 75 74 65 50 6f 73 69 |formAbso|lutePosi|
|000036e0| 74 69 6f 6e 2c 20 26 6b | 65 79 44 61 74 61 2c 20 |tion, &k|eyData, |
|000036f0| 74 72 75 65 2c 20 74 6f | 6b 65 6e 43 6f 6e 74 65 |true, to|kenConte|
|00003700| 6e 74 73 29 3b 0d 09 09 | 09 09 09 09 7d 0d 09 09 |nts);...|....}...|
|00003710| 09 09 09 7d 0d 09 09 09 | 09 7d 0d 09 09 09 7d 20 |...}....|.}....} |
|00003720| 62 72 65 61 6b 3b 0d 09 | 09 09 0d 09 09 7d 0d 09 |break;..|.....}..|
|00003730| 7d 0d 09 65 6c 73 65 0d | 09 09 69 66 20 28 74 6f |}..else.|..if (to|
|00003740| 6b 65 6e 46 6c 61 67 73 | 28 2a 74 68 65 54 6f 6b |kenFlags|(*theTok|
|00003750| 65 6e 29 20 26 20 6b 4f | 62 6a 65 63 74 54 6f 6b |en) & kO|bjectTok|
|00003760| 65 6e 29 20 7b 0d 09 09 | 09 2f 2a 20 54 68 65 20 |en) {...|./* The |
|00003770| 64 65 66 61 75 6c 74 20 | 72 65 70 72 65 73 65 6e |default |represen|
|00003780| 74 61 74 69 6f 6e 20 66 | 6f 72 20 61 20 77 69 6e |tation f|or a win|
|00003790| 64 6f 77 20 6f 72 20 64 | 6f 63 75 6d 65 6e 74 20 |dow or d|ocument |
|000037a0| 69 73 20 61 6e 20 6f 62 | 6a 65 63 74 20 73 70 65 |is an ob|ject spe|
|000037b0| 63 69 66 69 65 72 20 2a | 2f 0d 09 09 09 6c 6f 6e |cifier *|/....lon|
|000037c0| 67 09 69 6e 64 65 78 3b | 0d 09 09 09 41 45 44 65 |g.index;|....AEDe|
|000037d0| 73 63 09 6e 75 6c 6c 43 | 6f 6e 74 61 69 6e 65 72 |sc.nullC|ontainer|
|000037e0| 20 3d 20 7b 74 79 70 65 | 4e 75 6c 6c 2c 20 4e 55 | = {type|Null, NU|
|000037f0| 4c 4c 7d 3b 0d 09 09 09 | 0d 09 09 09 2f 2a 20 57 |LL};....|..../* W|
|00003800| 65 20 77 61 6e 74 20 61 | 6e 20 6f 62 6a 65 63 74 |e want a|n object|
|00003810| 20 73 70 65 63 69 66 69 | 65 72 20 6f 66 20 74 68 | specifi|er of th|
|00003820| 65 20 66 6f 72 6d 20 22 | 64 6f 63 75 6d 65 6e 74 |e form "|document|
|00003830| 20 6d 22 20 2a 2f 0d 09 | 09 09 69 6e 64 65 78 20 | m" */..|..index |
|00003840| 3d 20 47 65 74 57 69 6e | 64 6f 77 49 6e 64 65 78 |= GetWin|dowIndex|
|00003850| 28 74 68 65 57 69 6e 64 | 6f 77 29 3b 0d 09 09 09 |(theWind|ow);....|
|00003860| 65 72 72 20 3d 20 43 72 | 65 61 74 65 4f 66 66 73 |err = Cr|eateOffs|
|00003870| 65 74 44 65 73 63 72 69 | 70 74 6f 72 28 69 6e 64 |etDescri|ptor(ind|
|00003880| 65 78 2c 20 26 6b 65 79 | 44 61 74 61 29 3b 0d 09 |ex, &key|Data);..|
|00003890| 09 09 69 66 20 28 65 72 | 72 20 3d 3d 20 6e 6f 45 |..if (er|r == noE|
|000038a0| 72 72 29 0d 09 09 09 09 | 65 72 72 20 3d 20 43 72 |rr).....|err = Cr|
|000038b0| 65 61 74 65 4f 62 6a 53 | 70 65 63 69 66 69 65 72 |eateObjS|pecifier|
|000038c0| 28 63 44 6f 63 75 6d 65 | 6e 74 2c 20 26 6e 75 6c |(cDocume|nt, &nul|
|000038d0| 6c 43 6f 6e 74 61 69 6e | 65 72 2c 20 66 6f 72 6d |lContain|er, form|
|000038e0| 41 62 73 6f 6c 75 74 65 | 50 6f 73 69 74 69 6f 6e |Absolute|Position|
|000038f0| 2c 20 26 6b 65 79 44 61 | 74 61 2c 20 74 72 75 65 |, &keyDa|ta, true|
|00003900| 2c 20 74 6f 6b 65 6e 43 | 6f 6e 74 65 6e 74 73 29 |, tokenC|ontents)|
|00003910| 3b 0d 09 09 7d 0d 09 65 | 6c 73 65 0d 09 09 65 72 |;...}..e|lse...er|
|00003920| 72 20 3d 20 65 72 72 41 | 45 45 76 65 6e 74 46 61 |r = errA|EEventFa|
|00003930| 69 6c 65 64 3b 0d 09 0d | 09 72 65 74 75 72 6e 20 |iled;...|.return |
|00003940| 65 72 72 3b 0d 7d 0d 0d | 0d 4f 53 45 72 72 20 57 |err;.}..|.OSErr W|
|00003950| 69 6e 5f 57 72 69 74 65 | 54 6f 6b 65 6e 44 61 74 |in_Write|TokenDat|
|00003960| 61 28 63 6f 6e 73 74 20 | 41 45 44 65 73 63 20 2a |a(const |AEDesc *|
|00003970| 74 68 65 54 6f 6b 65 6e | 2c 20 63 6f 6e 73 74 20 |theToken|, const |
|00003980| 41 45 44 65 73 63 20 2a | 64 61 74 61 29 0d 7b 0d |AEDesc *|data).{.|
|00003990| 09 4f 53 45 72 72 09 09 | 65 72 72 09 09 09 3d 20 |.OSErr..|err...= |
|000039a0| 6e 6f 45 72 72 3b 0d 09 | 6c 6f 6e 67 09 09 6e 75 |noErr;..|long..nu|
|000039b0| 6d 49 74 65 6d 73 2c 20 | 69 6e 64 65 78 3b 0d 09 |mItems, |index;..|
|000039c0| 41 45 44 65 73 63 09 09 | 63 75 72 72 49 74 65 6d |AEDesc..|currItem|
|000039d0| 44 65 73 63 20 3d 20 7b | 27 6e 75 6c 6c 27 2c 20 |Desc = {|'null', |
|000039e0| 4e 55 4c 4c 7d 3b 0d 20 | 20 20 20 41 45 4b 65 79 |NULL};. | AEKey|
|000039f0| 77 6f 72 64 20 09 74 68 | 65 41 45 4b 65 79 77 6f |word .th|eAEKeywo|
|00003a00| 72 64 3b 0d 20 20 20 20 | 44 65 73 63 54 79 70 65 |rd;. |DescType|
|00003a10| 09 70 72 6f 70 43 6f 64 | 65 3b 0d 20 20 20 20 41 |.propCod|e;. A|
|00003a20| 45 44 65 73 63 09 09 63 | 6f 65 72 63 65 64 44 61 |EDesc..c|oercedDa|
|00003a30| 74 61 20 3d 20 7b 27 6e | 75 6c 6c 27 2c 20 4e 55 |ta = {'n|ull', NU|
|00003a40| 4c 4c 7d 3b 0d 20 20 20 | 20 57 69 6e 64 6f 77 50 |LL};. | WindowP|
|00003a50| 74 72 09 74 68 65 57 69 | 6e 64 6f 77 3b 0d 20 20 |tr.theWi|ndow;. |
|00003a60| 20 20 0d 09 70 72 6f 70 | 43 6f 64 65 20 3d 20 74 | ..prop|Code = t|
|00003a70| 6f 6b 65 6e 50 72 6f 70 | 43 6f 64 65 28 2a 74 68 |okenProp|Code(*th|
|00003a80| 65 54 6f 6b 65 6e 29 3b | 0d 09 74 68 65 57 69 6e |eToken);|..theWin|
|00003a90| 64 6f 77 20 3d 20 74 6f | 6b 65 6e 57 69 6e 64 6f |dow = to|kenWindo|
|00003aa0| 77 28 2a 74 68 65 54 6f | 6b 65 6e 29 3b 0d 09 0d |w(*theTo|ken);...|
|00003ab0| 09 73 77 69 74 63 68 28 | 70 72 6f 70 43 6f 64 65 |.switch(|propCode|
|00003ac0| 29 20 7b 0d 09 0d 09 09 | 63 61 73 65 20 70 42 6f |) {.....|case pBo|
|00003ad0| 75 6e 64 73 3a 20 7b 0d | 09 09 09 2f 2a 20 20 43 |unds: {.|.../* C|
|00003ae0| 68 61 6e 67 65 20 74 68 | 65 20 62 6f 75 6e 64 73 |hange th|e bounds|
|00003af0| 20 6f 66 20 74 68 65 20 | 77 69 6e 64 6f 77 2e 20 | of the |window. |
|00003b00| 54 68 65 20 64 61 74 61 | 20 73 68 6f 75 6c 64 20 |The data| should |
|00003b10| 62 65 20 61 20 51 44 52 | 65 63 74 20 2a 2f 0d 09 |be a QDR|ect */..|
|00003b20| 09 09 52 65 63 74 09 6e | 65 77 42 6f 75 6e 64 73 |..Rect.n|ewBounds|
|00003b30| 3b 0d 09 09 09 0d 09 09 | 09 65 72 72 20 3d 20 41 |;.......|.err = A|
|00003b40| 45 43 6f 65 72 63 65 44 | 65 73 63 28 64 61 74 61 |ECoerceD|esc(data|
|00003b50| 2c 20 74 79 70 65 51 44 | 52 65 63 74 61 6e 67 6c |, typeQD|Rectangl|
|00003b60| 65 2c 20 26 63 6f 65 72 | 63 65 64 44 61 74 61 29 |e, &coer|cedData)|
|00003b70| 3b 0d 09 09 09 69 66 20 | 28 65 72 72 20 21 3d 20 |;....if |(err != |
|00003b80| 6e 6f 45 72 72 29 20 7b | 0d 09 09 09 09 6e 65 77 |noErr) {|.....new|
|00003b90| 42 6f 75 6e 64 73 20 3d | 20 2a 2a 28 52 65 63 74 |Bounds =| **(Rect|
|00003ba0| 2a 2a 29 63 6f 65 72 63 | 65 64 44 61 74 61 2e 64 |**)coerc|edData.d|
|00003bb0| 61 74 61 48 61 6e 64 6c | 65 3b 0d 09 09 09 09 4d |ataHandl|e;.....M|
|00003bc0| 6f 76 65 57 69 6e 64 6f | 77 28 74 68 65 57 69 6e |oveWindo|w(theWin|
|00003bd0| 64 6f 77 2c 20 6e 65 77 | 42 6f 75 6e 64 73 2e 6c |dow, new|Bounds.l|
|00003be0| 65 66 74 2c 20 6e 65 77 | 42 6f 75 6e 64 73 2e 74 |eft, new|Bounds.t|
|00003bf0| 6f 70 2c 20 66 61 6c 73 | 65 29 3b 0d 09 09 09 09 |op, fals|e);.....|
|00003c00| 53 69 7a 65 57 69 6e 64 | 6f 77 28 74 68 65 57 69 |SizeWind|ow(theWi|
|00003c10| 6e 64 6f 77 2c 20 6e 65 | 77 42 6f 75 6e 64 73 2e |ndow, ne|wBounds.|
|00003c20| 72 69 67 68 74 20 2d 20 | 6e 65 77 42 6f 75 6e 64 |right - |newBound|
|00003c30| 73 2e 6c 65 66 74 2c 20 | 0d 09 09 09 09 09 09 09 |s.left, |........|
|00003c40| 09 09 20 20 6e 65 77 42 | 6f 75 6e 64 73 2e 62 6f |.. newB|ounds.bo|
|00003c50| 74 74 6f 6d 20 2d 20 6e | 65 77 42 6f 75 6e 64 73 |ttom - n|ewBounds|
|00003c60| 2e 74 6f 70 2c 20 74 72 | 75 65 29 3b 0d 09 09 09 |.top, tr|ue);....|
|00003c70| 7d 0d 09 09 7d 20 62 72 | 65 61 6b 3b 0d 0d 09 09 |}...} br|eak;....|
|00003c80| 63 61 73 65 20 70 49 6e | 64 65 78 3a 20 7b 0d 09 |case pIn|dex: {..|
|00003c90| 09 09 2f 2a 20 20 4d 6f | 76 65 20 74 68 69 73 20 |../* Mo|ve this |
|00003ca0| 77 69 6e 64 6f 77 20 62 | 65 68 69 6e 64 20 61 6e |window b|ehind an|
|00003cb0| 6f 74 68 65 72 20 6f 6e | 65 20 2a 2f 0d 09 09 09 |other on|e */....|
|00003cc0| 6c 6f 6e 67 09 09 6e 65 | 77 49 6e 64 65 78 2c 20 |long..ne|wIndex, |
|00003cd0| 63 75 72 72 49 6e 64 65 | 78 3b 0d 09 09 09 57 69 |currInde|x;....Wi|
|00003ce0| 6e 64 6f 77 50 74 72 09 | 77 69 6e 64 6f 77 49 6e |ndowPtr.|windowIn|
|00003cf0| 46 72 6f 6e 74 3b 0d 09 | 09 09 0d 09 09 09 65 72 |Front;..|......er|
|00003d00| 72 20 3d 20 41 45 43 6f | 65 72 63 65 44 65 73 63 |r = AECo|erceDesc|
|00003d10| 28 64 61 74 61 2c 20 74 | 79 70 65 4c 6f 6e 67 49 |(data, t|ypeLongI|
|00003d20| 6e 74 65 67 65 72 2c 20 | 26 63 6f 65 72 63 65 64 |nteger, |&coerced|
|00003d30| 44 61 74 61 29 3b 0d 09 | 09 09 69 66 20 28 65 72 |Data);..|..if (er|
|00003d40| 72 20 21 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |r != noE|rr) {...|
|00003d50| 09 09 6e 65 77 49 6e 64 | 65 78 20 3d 20 2a 2a 28 |..newInd|ex = **(|
|00003d60| 73 68 6f 72 74 2a 2a 29 | 63 6f 65 72 63 65 64 44 |short**)|coercedD|
|00003d70| 61 74 61 2e 64 61 74 61 | 48 61 6e 64 6c 65 3b 0d |ata.data|Handle;.|
|00003d80| 09 09 09 09 63 75 72 72 | 49 6e 64 65 78 20 3d 20 |....curr|Index = |
|00003d90| 47 65 74 57 69 6e 64 6f | 77 49 6e 64 65 78 28 74 |GetWindo|wIndex(t|
|00003da0| 68 65 57 69 6e 64 6f 77 | 29 3b 0d 09 09 09 09 69 |heWindow|);.....i|
|00003db0| 66 20 28 6e 65 77 49 6e | 64 65 78 20 3d 3d 20 63 |f (newIn|dex == c|
|00003dc0| 75 72 72 49 6e 64 65 78 | 29 20 62 72 65 61 6b 3b |urrIndex|) break;|
|00003dd0| 09 09 2f 2a 20 20 57 65 | 27 72 65 20 64 6f 6e 65 |../* We|'re done|
|00003de0| 2c 20 73 6f 20 65 78 69 | 74 20 74 68 69 73 20 63 |, so exi|t this c|
|00003df0| 61 73 65 20 2a 2f 0d 09 | 09 09 09 0d 09 09 09 09 |ase */..|........|
|00003e00| 2f 2a 20 20 4f 74 68 65 | 72 77 69 73 65 2c 20 77 |/* Othe|rwise, w|
|00003e10| 65 20 68 61 76 65 20 74 | 6f 20 6d 6f 76 65 20 74 |e have t|o move t|
|00003e20| 68 65 20 77 69 6e 64 6f | 77 20 2a 2f 0d 09 09 09 |he windo|w */....|
|00003e30| 09 2f 2a 20 20 53 69 6e | 63 65 20 61 6c 6c 20 77 |./* Sin|ce all w|
|00003e40| 65 20 68 61 76 65 20 69 | 73 20 61 20 22 73 65 6e |e have i|s a "sen|
|00003e50| 64 20 62 65 68 69 6e 64 | 22 20 63 61 6c 6c 2c 20 |d behind|" call, |
|00003e60| 77 65 20 68 61 76 65 20 | 74 6f 20 63 61 6c 63 75 |we have |to calcu|
|00003e70| 6c 61 74 65 20 74 68 65 | 20 2a 2f 0d 09 09 09 09 |late the| */.....|
|00003e80| 2f 2a 20 20 6e 75 6d 62 | 65 72 20 6f 66 20 74 68 |/* numb|er of th|
|00003e90| 65 20 77 69 6e 64 6f 77 | 20 77 65 20 73 68 6f 75 |e window| we shou|
|00003ea0| 6c 64 20 73 69 74 20 62 | 65 68 69 6e 64 2e 20 54 |ld sit b|ehind. T|
|00003eb0| 68 65 20 72 75 6c 65 73 | 20 61 72 65 20 61 73 20 |he rules| are as |
|00003ec0| 66 6f 6c 6c 6f 77 73 3a | 20 2a 2f 0d 09 09 09 09 |follows:| */.....|
|00003ed0| 2f 2a 20 20 20 20 31 29 | 20 49 66 20 77 65 27 72 |/* 1)| If we'r|
|00003ee0| 65 20 6d 6f 76 69 6e 67 | 20 69 6e 74 6f 20 70 6f |e moving| into po|
|00003ef0| 73 69 74 69 6f 6e 20 31 | 2c 20 75 73 65 20 53 65 |sition 1|, use Se|
|00003f00| 6c 65 63 74 57 69 6e 64 | 6f 77 20 2a 2f 0d 09 09 |lectWind|ow */...|
|00003f10| 09 09 2f 2a 20 09 20 32 | 29 20 49 66 20 77 65 27 |../* . 2|) If we'|
|00003f20| 72 65 20 6d 6f 76 69 6e | 67 20 74 6f 20 61 20 68 |re movin|g to a h|
|00003f30| 69 67 68 65 72 20 69 6e | 64 65 78 20 23 20 28 66 |igher in|dex # (f|
|00003f40| 75 72 74 68 65 72 20 62 | 61 63 6b 29 2c 20 6d 6f |urther b|ack), mo|
|00003f50| 76 65 20 62 65 68 69 6e | 64 20 2a 2f 0d 09 09 09 |ve behin|d */....|
|00003f60| 09 2f 2a 20 09 09 74 68 | 65 20 77 69 6e 64 6f 77 |./* ..th|e window|
|00003f70| 20 77 69 74 68 20 74 68 | 65 20 64 65 73 74 69 6e | with th|e destin|
|00003f80| 61 74 69 6f 6e 20 69 6e | 64 65 78 20 6e 75 6d 62 |ation in|dex numb|
|00003f90| 65 72 20 2a 2f 0d 09 09 | 09 09 2f 2a 20 09 20 33 |er */...|../* . 3|
|00003fa0| 29 20 4f 74 68 65 72 77 | 69 73 65 2c 20 6d 6f 76 |) Otherw|ise, mov|
|00003fb0| 65 20 62 65 68 69 6e 64 | 20 74 68 65 20 77 69 6e |e behind| the win|
|00003fc0| 64 6f 77 20 77 69 74 68 | 20 61 6e 20 69 6e 64 65 |dow with| an inde|
|00003fd0| 78 20 6f 66 20 28 64 65 | 73 74 69 6e 61 74 69 6f |x of (de|stinatio|
|00003fe0| 6e 20 2d 20 31 29 20 2a | 2f 0d 09 09 09 09 0d 09 |n - 1) *|/.......|
|00003ff0| 09 09 09 69 66 20 28 6e | 65 77 49 6e 64 65 78 20 |...if (n|ewIndex |
|00004000| 3d 3d 20 31 29 0d 09 09 | 09 09 09 53 65 6c 65 63 |== 1)...|...Selec|
|00004010| 74 57 69 6e 64 6f 77 28 | 74 68 65 57 69 6e 64 6f |tWindow(|theWindo|
|00004020| 77 29 3b 0d 09 09 09 09 | 65 6c 73 65 20 7b 0d 09 |w);.....|else {..|
|00004030| 09 09 09 09 69 66 20 28 | 6e 65 77 49 6e 64 65 78 |....if (|newIndex|
|00004040| 20 3e 20 63 75 72 72 49 | 6e 64 65 78 29 20 7b 0d | > currI|ndex) {.|
|00004050| 09 09 09 09 09 09 77 69 | 6e 64 6f 77 49 6e 46 72 |......wi|ndowInFr|
|00004060| 6f 6e 74 20 3d 20 46 69 | 6e 64 49 6e 64 65 78 65 |ont = Fi|ndIndexe|
|00004070| 64 57 69 6e 64 6f 77 28 | 6e 65 77 49 6e 64 65 78 |dWindow(|newIndex|
|00004080| 29 3b 0d 09 09 09 09 09 | 09 53 65 6e 64 42 65 68 |);......|.SendBeh|
|00004090| 69 6e 64 28 74 68 65 57 | 69 6e 64 6f 77 2c 20 77 |ind(theW|indow, w|
|000040a0| 69 6e 64 6f 77 49 6e 46 | 72 6f 6e 74 29 3b 0d 09 |indowInF|ront);..|
|000040b0| 09 09 09 09 09 48 69 6c | 69 74 65 57 69 6e 64 6f |.....Hil|iteWindo|
|000040c0| 77 28 74 68 65 57 69 6e | 64 6f 77 2c 20 66 61 6c |w(theWin|dow, fal|
|000040d0| 73 65 29 3b 0d 09 09 09 | 09 09 7d 20 65 6c 73 65 |se);....|..} else|
|000040e0| 20 7b 0d 09 09 09 09 09 | 09 77 69 6e 64 6f 77 49 | {......|.windowI|
|000040f0| 6e 46 72 6f 6e 74 20 3d | 20 46 69 6e 64 49 6e 64 |nFront =| FindInd|
|00004100| 65 78 65 64 57 69 6e 64 | 6f 77 28 6e 65 77 49 6e |exedWind|ow(newIn|
|00004110| 64 65 78 20 2d 20 31 29 | 3b 0d 09 09 09 09 09 09 |dex - 1)|;.......|
|00004120| 53 65 6e 64 42 65 68 69 | 6e 64 28 74 68 65 57 69 |SendBehi|nd(theWi|
|00004130| 6e 64 6f 77 2c 20 77 69 | 6e 64 6f 77 49 6e 46 72 |ndow, wi|ndowInFr|
|00004140| 6f 6e 74 29 3b 0d 09 09 | 09 09 09 09 2f 2a 20 20 |ont);...|..../* |
|00004150| 72 65 71 75 69 72 65 64 | 20 63 6f 64 65 20 74 6f |required| code to|
|00004160| 20 6b 65 65 70 20 74 68 | 65 20 77 69 6e 64 6f 77 | keep th|e window|
|00004170| 20 6d 61 6e 61 67 65 72 | 20 68 61 70 70 79 20 69 | manager| happy i|
|00004180| 6e 20 74 68 69 73 20 6f | 6e 65 20 63 61 73 65 20 |n this o|ne case |
|00004190| 2a 2f 0d 09 09 09 09 09 | 09 50 61 69 6e 74 4f 6e |*/......|.PaintOn|
|000041a0| 65 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 74 68 |e((Windo|wPeek)th|
|000041b0| 65 57 69 6e 64 6f 77 2c | 20 28 28 57 69 6e 64 6f |eWindow,| ((Windo|
|000041c0| 77 50 65 65 6b 29 74 68 | 65 57 69 6e 64 6f 77 29 |wPeek)th|eWindow)|
|000041d0| 2d 3e 73 74 72 75 63 52 | 67 6e 29 3b 0d 09 09 09 |->strucR|gn);....|
|000041e0| 09 09 09 43 61 6c 63 56 | 69 73 28 28 57 69 6e 64 |...CalcV|is((Wind|
|000041f0| 6f 77 50 65 65 6b 29 74 | 68 65 57 69 6e 64 6f 77 |owPeek)t|heWindow|
|00004200| 29 3b 0d 09 09 09 09 09 | 09 53 65 6c 65 63 74 57 |);......|.SelectW|
|00004210| 69 6e 64 6f 77 28 46 72 | 6f 6e 74 57 69 6e 64 6f |indow(Fr|ontWindo|
|00004220| 77 28 29 29 3b 09 2f 2a | 20 20 54 68 69 73 20 69 |w());./*| This i|
|00004230| 73 20 73 69 6d 70 6c 65 | 20 70 61 72 61 6e 6f 69 |s simple| paranoi|
|00004240| 61 2c 20 62 75 74 20 49 | 20 77 61 6e 74 20 74 6f |a, but I| want to|
|00004250| 20 6d 61 6b 65 20 73 75 | 72 65 20 61 6c 6c 20 6f | make su|re all o|
|00004260| 66 20 74 68 65 20 61 63 | 74 69 76 61 74 65 73 20 |f the ac|tivates |
|00004270| 68 61 70 70 65 6e 20 63 | 6f 72 72 65 63 74 6c 79 |happen c|orrectly|
|00004280| 20 2a 2f 0d 09 09 09 09 | 09 7d 0d 09 09 09 09 09 | */.....|.}......|
|00004290| 48 69 6c 69 74 65 57 69 | 6e 64 6f 77 28 74 68 65 |HiliteWi|ndow(the|
|000042a0| 57 69 6e 64 6f 77 2c 20 | 66 61 6c 73 65 29 3b 0d |Window, |false);.|
|000042b0| 09 09 09 09 09 53 65 6c | 65 63 74 57 69 6e 64 6f |.....Sel|ectWindo|
|000042c0| 77 28 46 72 6f 6e 74 57 | 69 6e 64 6f 77 28 29 29 |w(FrontW|indow())|
|000042d0| 3b 09 2f 2a 20 20 54 68 | 69 73 20 69 73 20 73 69 |;./* Th|is is si|
|000042e0| 6d 70 6c 65 20 70 61 72 | 61 6e 6f 69 61 2c 20 62 |mple par|anoia, b|
|000042f0| 75 74 20 49 20 77 61 6e | 74 20 74 6f 20 6d 61 6b |ut I wan|t to mak|
|00004300| 65 20 73 75 72 65 20 61 | 6c 6c 20 6f 66 20 74 68 |e sure a|ll of th|
|00004310| 65 20 61 63 74 69 76 61 | 74 65 73 20 68 61 70 70 |e activa|tes happ|
|00004320| 65 6e 20 63 6f 72 72 65 | 63 74 6c 79 20 2a 2f 0d |en corre|ctly */.|
|00004330| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 09 09 7d 20 62 |....}...|.}...} b|
|00004340| 72 65 61 6b 3b 0d 0d 09 | 09 63 61 73 65 20 70 49 |reak;...|.case pI|
|00004350| 73 5a 6f 6f 6d 65 64 3a | 0d 09 09 09 2f 2a 20 20 |sZoomed:|..../* |
|00004360| 54 68 69 73 20 77 69 6e | 64 6f 77 20 69 73 6e 27 |This win|dow isn'|
|00004370| 74 20 7a 6f 6f 6d 61 62 | 6c 65 2c 20 73 6f 20 74 |t zoomab|le, so t|
|00004380| 68 69 73 20 69 73 20 61 | 20 6e 6f 2d 6f 70 20 2a |his is a| no-op *|
|00004390| 2f 0d 09 09 62 72 65 61 | 6b 3b 0d 0d 09 09 63 61 |/...brea|k;....ca|
|000043a0| 73 65 20 70 4e 61 6d 65 | 3a 20 7b 0d 09 09 09 2f |se pName|: {..../|
|000043b0| 2a 20 20 43 68 61 6e 67 | 65 20 74 68 65 20 6e 61 |* Chang|e the na|
|000043c0| 6d 65 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |me of th|e window|
|000043d0| 20 28 61 6e 64 20 74 68 | 65 20 6e 61 6d 65 20 6f | (and th|e name o|
|000043e0| 66 20 74 68 65 20 66 69 | 6c 65 29 20 2a 2f 0d 09 |f the fi|le) */..|
|000043f0| 09 09 2f 2a 20 57 65 20 | 64 6f 6e 27 74 20 64 6f |../* We |don't do|
|00004400| 20 74 68 69 73 20 2a 2f | 0d 09 09 09 72 65 74 75 | this */|....retu|
|00004410| 72 6e 20 65 72 72 41 45 | 57 72 69 74 65 44 65 6e |rn errAE|WriteDen|
|00004420| 69 65 64 3b 0d 09 09 7d | 20 62 72 65 61 6b 3b 0d |ied;...}| break;.|
|00004430| 0d 09 09 63 61 73 65 20 | 70 53 65 6c 65 63 74 69 |...case |pSelecti|
|00004440| 6f 6e 3a 20 7b 0d 09 09 | 09 2f 2a 20 20 53 65 74 |on: {...|./* Set|
|00004450| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 73 65 6c | the cur|rent sel|
|00004460| 65 63 74 69 6f 6e 20 75 | 6e 64 65 72 20 70 72 6f |ection u|nder pro|
|00004470| 67 72 61 6d 20 63 6f 6e | 74 72 6f 6c 2e 20 2a 2f |gram con|trol. */|
|00004480| 0d 09 09 09 2f 2a 20 57 | 65 20 64 6f 6e 27 74 20 |..../* W|e don't |
|00004490| 64 6f 20 74 68 69 73 20 | 2a 2f 0d 09 09 09 72 65 |do this |*/....re|
|000044a0| 74 75 72 6e 20 65 72 72 | 41 45 57 72 69 74 65 44 |turn err|AEWriteD|
|000044b0| 65 6e 69 65 64 3b 0d 09 | 09 7d 20 62 72 65 61 6b |enied;..|.} break|
|000044c0| 3b 0d 0d 09 09 63 61 73 | 65 20 70 56 69 73 69 62 |;....cas|e pVisib|
|000044d0| 6c 65 3a 20 7b 0d 09 09 | 09 2f 2a 20 20 53 68 6f |le: {...|./* Sho|
|000044e0| 77 20 6f 72 20 68 69 64 | 65 20 74 68 65 20 77 69 |w or hid|e the wi|
|000044f0| 6e 64 6f 77 2e 20 54 68 | 65 20 64 61 74 61 20 73 |ndow. Th|e data s|
|00004500| 68 6f 75 6c 64 20 62 65 | 20 61 20 63 68 61 72 20 |hould be| a char |
|00004510| 77 69 74 68 20 74 68 65 | 20 76 61 6c 75 65 20 30 |with the| value 0|
|00004520| 20 6f 72 20 31 20 2a 2f | 0d 09 09 09 2f 2a 20 20 | or 1 */|..../* |
|00004530| 28 53 69 6e 63 65 20 70 | 6f 69 6e 74 65 72 73 20 |(Since p|ointers |
|00004540| 61 72 65 20 64 65 63 6c | 61 72 65 64 20 61 73 20 |are decl|ared as |
|00004550| 63 68 61 72 2a 2c 20 77 | 65 20 64 6f 6e 27 74 20 |char*, w|e don't |
|00004560| 6e 65 65 64 20 74 6f 20 | 63 61 73 74 29 20 2a 2f |need to |cast) */|
|00004570| 0d 09 09 09 65 72 72 20 | 3d 20 41 45 43 6f 65 72 |....err |= AECoer|
|00004580| 63 65 44 65 73 63 28 64 | 61 74 61 2c 20 74 79 70 |ceDesc(d|ata, typ|
|00004590| 65 42 6f 6f 6c 65 61 6e | 2c 20 26 63 6f 65 72 63 |eBoolean|, &coerc|
|000045a0| 65 64 44 61 74 61 29 3b | 0d 09 09 09 69 66 20 28 |edData);|....if (|
|000045b0| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 7b 0d |err != n|oErr) {.|
|000045c0| 09 09 09 09 69 66 20 28 | 2a 2a 63 6f 65 72 63 65 |....if (|**coerce|
|000045d0| 64 44 61 74 61 2e 64 61 | 74 61 48 61 6e 64 6c 65 |dData.da|taHandle|
|000045e0| 20 21 3d 20 30 29 0d 09 | 09 09 09 09 53 68 6f 77 | != 0)..|....Show|
|000045f0| 57 69 6e 64 6f 77 28 74 | 68 65 57 69 6e 64 6f 77 |Window(t|heWindow|
|00004600| 29 3b 0d 09 09 09 09 65 | 6c 73 65 0d 09 09 09 09 |);.....e|lse.....|
|00004610| 09 48 69 64 65 57 69 6e | 64 6f 77 28 74 68 65 57 |.HideWin|dow(theW|
|00004620| 69 6e 64 6f 77 29 3b 0d | 09 09 09 7d 0d 09 09 7d |indow);.|...}...}|
|00004630| 20 62 72 65 61 6b 3b 0d | 0d 09 09 64 65 66 61 75 | break;.|...defau|
|00004640| 6c 74 3a 0d 09 09 09 65 | 72 72 20 3d 20 65 72 72 |lt:....e|rr = err|
|00004650| 41 45 4e 6f 74 4d 6f 64 | 69 66 69 61 62 6c 65 3b |AENotMod|ifiable;|
|00004660| 0d 09 7d 0d 09 69 66 20 | 28 63 6f 65 72 63 65 64 |..}..if |(coerced|
|00004670| 44 61 74 61 2e 64 61 74 | 61 48 61 6e 64 6c 65 20 |Data.dat|aHandle |
|00004680| 21 3d 20 4e 55 4c 4c 29 | 20 0d 09 09 28 76 6f 69 |!= NULL)| ...(voi|
|00004690| 64 29 41 45 44 69 73 70 | 6f 73 65 44 65 73 63 28 |d)AEDisp|oseDesc(|
|000046a0| 26 63 6f 65 72 63 65 64 | 44 61 74 61 29 3b 0d 09 |&coerced|Data);..|
|000046b0| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 7d 0d 0d 0d |return e|rr;.}...|
|000046c0| 4f 53 45 72 72 20 57 69 | 6e 5f 41 45 5f 44 69 73 |OSErr Wi|n_AE_Dis|
|000046d0| 70 61 74 63 68 65 72 28 | 63 6f 6e 73 74 20 41 70 |patcher(|const Ap|
|000046e0| 70 6c 65 45 76 65 6e 74 | 20 2a 6d 65 73 73 61 67 |pleEvent| *messag|
|000046f0| 65 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 72 |e, Apple|Event *r|
|00004700| 65 70 6c 79 2c 20 6c 6f | 6e 67 20 72 65 66 43 6f |eply, lo|ng refCo|
|00004710| 6e 2c 0d 09 09 09 09 09 | 09 41 45 45 76 65 6e 74 |n,......|.AEEvent|
|00004720| 43 6c 61 73 73 20 63 6c | 61 73 73 49 44 2c 20 41 |Class cl|assID, A|
|00004730| 45 45 76 65 6e 74 49 44 | 20 65 76 65 6e 74 49 44 |EEventID| eventID|
|00004740| 2c 0d 09 09 09 09 09 09 | 63 6f 6e 73 74 20 41 45 |,.......|const AE|
|00004750| 44 65 73 63 20 2a 6f 73 | 70 65 63 2c 20 63 6f 6e |Desc *os|pec, con|
|00004760| 73 74 20 41 45 44 65 73 | 63 20 2a 74 6f 6b 65 6e |st AEDes|c *token|
|00004770| 29 0d 7b 0d 09 4f 53 45 | 72 72 09 65 72 72 20 3d |).{..OSE|rr.err =|
|00004780| 20 6e 6f 45 72 72 3b 0d | 09 41 45 44 65 73 63 09 | noErr;.|.AEDesc.|
|00004790| 72 65 70 6c 79 44 65 73 | 63 20 3d 20 7b 27 6e 75 |replyDes|c = {'nu|
|000047a0| 6c 6c 27 2c 20 30 4c 7d | 3b 0d 0d 09 69 66 20 28 |ll', 0L}|;...if (|
|000047b0| 63 6c 61 73 73 49 44 20 | 3d 3d 20 6b 41 45 43 6f |classID |== kAECo|
|000047c0| 72 65 53 75 69 74 65 29 | 20 7b 0d 09 09 73 77 69 |reSuite)| {...swi|
|000047d0| 74 63 68 20 28 65 76 65 | 6e 74 49 44 29 20 7b 0d |tch (eve|ntID) {.|
|000047e0| 09 09 09 63 61 73 65 20 | 6b 41 45 43 72 65 61 74 |...case |kAECreat|
|000047f0| 65 45 6c 65 6d 65 6e 74 | 3a 0d 09 09 09 09 65 72 |eElement|:.....er|
|00004800| 72 20 3d 20 20 57 69 6e | 5f 43 72 65 61 74 65 45 |r = Win|_CreateE|
|00004810| 6c 65 6d 65 6e 74 28 6d | 65 73 73 61 67 65 2c 20 |lement(m|essage, |
|00004820| 72 65 70 6c 79 2c 20 72 | 65 66 43 6f 6e 2c 20 74 |reply, r|efCon, t|
|00004830| 6f 6b 65 6e 2c 20 26 72 | 65 70 6c 79 44 65 73 63 |oken, &r|eplyDesc|
|00004840| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 0d 09 09 |);....br|eak;....|
|00004850| 09 63 61 73 65 20 6b 41 | 45 43 6c 6f 73 65 3a 0d |.case kA|EClose:.|
|00004860| 09 09 09 63 61 73 65 20 | 6b 41 45 44 65 6c 65 74 |...case |kAEDelet|
|00004870| 65 3a 0d 09 09 09 09 65 | 72 72 20 3d 20 20 57 69 |e:.....e|rr = Wi|
|00004880| 6e 5f 43 6c 6f 73 65 28 | 6d 65 73 73 61 67 65 2c |n_Close(|message,|
|00004890| 20 72 65 70 6c 79 2c 20 | 72 65 66 43 6f 6e 2c 20 | reply, |refCon, |
|000048a0| 74 6f 6b 65 6e 2c 20 26 | 72 65 70 6c 79 44 65 73 |token, &|replyDes|
|000048b0| 63 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 0d 09 |c);....b|reak;...|
|000048c0| 09 09 63 61 73 65 20 6b | 41 45 47 65 74 44 61 74 |..case k|AEGetDat|
|000048d0| 61 3a 0d 09 09 09 09 65 | 72 72 20 3d 20 20 57 69 |a:.....e|rr = Wi|
|000048e0| 6e 5f 47 65 74 44 61 74 | 61 28 6d 65 73 73 61 67 |n_GetDat|a(messag|
|000048f0| 65 2c 20 72 65 70 6c 79 | 2c 20 72 65 66 43 6f 6e |e, reply|, refCon|
|00004900| 2c 20 74 6f 6b 65 6e 2c | 20 26 72 65 70 6c 79 44 |, token,| &replyD|
|00004910| 65 73 63 29 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |esc);...|.break;.|
|00004920| 0d 09 09 09 63 61 73 65 | 20 6b 41 45 47 65 74 44 |....case| kAEGetD|
|00004930| 61 74 61 53 69 7a 65 3a | 20 7b 0d 09 09 09 09 2f |ataSize:| {...../|
|00004940| 2a 20 20 57 65 27 6c 6c | 20 64 6f 20 74 68 69 73 |* We'll| do this|
|00004950| 20 6f 6e 65 20 62 79 20 | 65 78 65 63 75 74 69 6e | one by |executin|
|00004960| 67 20 22 47 65 74 20 44 | 61 74 61 22 20 61 6e 64 |g "Get D|ata" and|
|00004970| 20 74 68 65 6e 20 72 65 | 74 75 72 6e 69 6e 67 20 | then re|turning |
|00004980| 74 68 65 20 20 2a 2f 0d | 09 09 09 09 2f 2a 20 20 |the */.|..../* |
|00004990| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 69 6e 66 6f |size of |the info|
|000049a0| 72 6d 61 74 69 6f 6e 2e | 20 54 68 69 73 20 69 73 |rmation.| This is|
|000049b0| 20 6e 6f 74 20 6e 65 63 | 65 73 61 72 69 6c 79 20 | not nec|esarily |
|000049c0| 74 68 65 20 6d 6f 73 74 | 20 65 66 66 69 63 69 65 |the most| efficie|
|000049d0| 6e 74 20 2a 2f 0d 09 09 | 09 09 2f 2a 20 20 77 61 |nt */...|../* wa|
|000049e0| 79 20 74 6f 20 64 6f 20 | 74 68 69 6e 67 73 20 69 |y to do |things i|
|000049f0| 66 20 79 6f 75 72 20 72 | 65 74 75 72 6e 65 64 20 |f your r|eturned |
|00004a00| 64 61 74 61 20 69 73 20 | 6c 61 72 67 65 2e 20 2a |data is |large. *|
|00004a10| 2f 0d 09 09 09 09 0d 09 | 09 09 09 41 45 44 65 73 |/.......|...AEDes|
|00004a20| 63 09 74 65 6d 70 44 65 | 73 63 20 3d 20 7b 27 6e |c.tempDe|sc = {'n|
|00004a30| 75 6c 6c 27 2c 20 4e 55 | 4c 4c 7d 3b 0d 09 09 09 |ull', NU|LL};....|
|00004a40| 09 6c 6f 6e 67 09 64 61 | 74 61 53 69 7a 65 3b 0d |.long.da|taSize;.|
|00004a50| 09 09 09 09 0d 09 09 09 | 09 65 72 72 20 3d 20 57 |........|.err = W|
|00004a60| 69 6e 5f 47 65 74 44 61 | 74 61 28 6d 65 73 73 61 |in_GetDa|ta(messa|
|00004a70| 67 65 2c 20 72 65 70 6c | 79 2c 20 72 65 66 43 6f |ge, repl|y, refCo|
|00004a80| 6e 2c 20 74 6f 6b 65 6e | 2c 20 26 74 65 6d 70 44 |n, token|, &tempD|
|00004a90| 65 73 63 29 3b 0d 09 09 | 09 09 69 66 20 28 74 65 |esc);...|..if (te|
|00004aa0| 6d 70 44 65 73 63 2e 64 | 61 74 61 48 61 6e 64 6c |mpDesc.d|ataHandl|
|00004ab0| 65 20 21 3d 20 4e 55 4c | 4c 29 20 7b 0d 09 09 09 |e != NUL|L) {....|
|00004ac0| 09 09 64 61 74 61 53 69 | 7a 65 20 3d 20 47 65 74 |..dataSi|ze = Get|
|00004ad0| 48 61 6e 64 6c 65 53 69 | 7a 65 28 74 65 6d 70 44 |HandleSi|ze(tempD|
|00004ae0| 65 73 63 2e 64 61 74 61 | 48 61 6e 64 6c 65 29 3b |esc.data|Handle);|
|00004af0| 0d 09 09 09 09 09 28 76 | 6f 69 64 29 41 45 43 72 |......(v|oid)AECr|
|00004b00| 65 61 74 65 44 65 73 63 | 28 74 79 70 65 4c 6f 6e |eateDesc|(typeLon|
|00004b10| 67 49 6e 74 65 67 65 72 | 2c 20 28 50 74 72 29 26 |gInteger|, (Ptr)&|
|00004b20| 64 61 74 61 53 69 7a 65 | 2c 20 73 69 7a 65 6f 66 |dataSize|, sizeof|
|00004b30| 28 64 61 74 61 53 69 7a | 65 29 2c 20 26 72 65 70 |(dataSiz|e), &rep|
|00004b40| 6c 79 44 65 73 63 29 3b | 0d 09 09 09 09 09 28 76 |lyDesc);|......(v|
|00004b50| 6f 69 64 29 41 45 44 69 | 73 70 6f 73 65 44 65 73 |oid)AEDi|sposeDes|
|00004b60| 63 28 26 74 65 6d 70 44 | 65 73 63 29 3b 0d 09 09 |c(&tempD|esc);...|
|00004b70| 09 09 7d 0d 09 09 09 7d | 0d 09 09 09 62 72 65 61 |..}....}|....brea|
|00004b80| 6b 3b 0d 0d 09 09 09 63 | 61 73 65 20 6b 41 45 53 |k;.....c|ase kAES|
|00004b90| 65 74 44 61 74 61 3a 0d | 09 09 09 09 65 72 72 20 |etData:.|....err |
|00004ba0| 3d 20 20 57 69 6e 5f 53 | 65 74 44 61 74 61 28 6d |= Win_S|etData(m|
|00004bb0| 65 73 73 61 67 65 2c 20 | 72 65 70 6c 79 2c 20 72 |essage, |reply, r|
|00004bc0| 65 66 43 6f 6e 2c 20 74 | 6f 6b 65 6e 2c 20 26 72 |efCon, t|oken, &r|
|00004bd0| 65 70 6c 79 44 65 73 63 | 29 3b 0d 09 09 09 62 72 |eplyDesc|);....br|
|00004be0| 65 61 6b 3b 0d 0d 09 09 | 09 2f 2a 20 45 76 65 6e |eak;....|./* Even|
|00004bf0| 74 73 20 74 68 61 74 20 | 77 65 20 64 6f 6e 27 74 |ts that |we don't|
|00004c00| 20 64 6f 20 2a 2f 0d 09 | 09 09 63 61 73 65 20 6b | do */..|..case k|
|00004c10| 41 45 53 61 76 65 3a 09 | 09 09 09 09 2f 2a 20 43 |AESave:.|..../* C|
|00004c20| 68 61 6e 67 65 73 20 61 | 72 65 20 73 61 76 65 64 |hanges a|re saved|
|00004c30| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 20 2a | automat|ically *|
|00004c40| 2f 0d 09 09 09 63 61 73 | 65 20 6b 41 45 52 65 76 |/....cas|e kAERev|
|00004c50| 65 72 74 3a 0d 09 09 09 | 63 61 73 65 20 6b 41 45 |ert:....|case kAE|
|00004c60| 50 72 69 6e 74 3a 09 09 | 09 09 09 2f 2a 20 53 6f |Print:..|.../* So|
|00004c70| 72 72 79 2c 20 6e 6f 20 | 70 72 69 6e 74 69 6e 67 |rry, no |printing|
|00004c80| 20 2a 2f 0d 09 09 09 63 | 61 73 65 20 6b 41 45 43 | */....c|ase kAEC|
|00004c90| 6c 6f 6e 65 3a 09 09 09 | 09 09 2f 2a 20 54 68 65 |lone:...|../* The|
|00004ca0| 73 65 20 6f 74 68 65 72 | 20 65 76 65 6e 74 73 20 |se other| events |
|00004cb0| 61 72 65 20 6c 65 66 74 | 20 75 70 20 74 6f 20 79 |are left| up to y|
|00004cc0| 6f 75 21 20 2a 2f 0d 09 | 09 09 63 61 73 65 20 6b |ou! */..|..case k|
|00004cd0| 41 45 43 6f 75 6e 74 45 | 6c 65 6d 65 6e 74 73 3a |AECountE|lements:|
|00004ce0| 0d 09 09 09 63 61 73 65 | 20 6b 41 45 44 6f 4f 62 |....case| kAEDoOb|
|00004cf0| 6a 65 63 74 73 45 78 69 | 73 74 3a 0d 09 09 09 63 |jectsExi|st:....c|
|00004d00| 61 73 65 20 6b 41 45 47 | 65 74 43 6c 61 73 73 49 |ase kAEG|etClassI|
|00004d10| 6e 66 6f 3a 0d 09 09 09 | 63 61 73 65 20 6b 41 45 |nfo:....|case kAE|
|00004d20| 4d 6f 76 65 3a 0d 09 09 | 09 63 61 73 65 20 6b 41 |Move:...|.case kA|
|00004d30| 45 4f 70 65 6e 3a 0d 09 | 09 09 64 65 66 61 75 6c |EOpen:..|..defaul|
|00004d40| 74 3a 0d 09 09 09 09 65 | 72 72 20 3d 20 65 72 72 |t:.....e|rr = err|
|00004d50| 41 45 45 76 65 6e 74 4e | 6f 74 48 61 6e 64 6c 65 |AEEventN|otHandle|
|00004d60| 64 20 3b 0d 09 09 7d 0d | 09 7d 0d 09 65 6c 73 65 |d ;...}.|.}..else|
|00004d70| 0d 09 09 65 72 72 20 3d | 20 65 72 72 41 45 45 76 |...err =| errAEEv|
|00004d80| 65 6e 74 4e 6f 74 48 61 | 6e 64 6c 65 64 3b 0d 0d |entNotHa|ndled;..|
|00004d90| 09 2f 2a 20 53 65 65 20 | 69 66 20 77 65 20 6e 65 |./* See |if we ne|
|00004da0| 65 64 20 74 6f 20 72 65 | 74 75 72 6e 20 61 6e 79 |ed to re|turn any|
|00004db0| 74 68 69 6e 67 20 2a 2f | 0d 09 69 66 20 28 28 65 |thing */|..if ((e|
|00004dc0| 72 72 20 3d 3d 20 6e 6f | 45 72 72 29 20 26 26 20 |rr == no|Err) && |
|00004dd0| 28 72 65 70 6c 79 44 65 | 73 63 2e 64 65 73 63 72 |(replyDe|sc.descr|
|00004de0| 69 70 74 6f 72 54 79 70 | 65 20 21 3d 20 27 6e 75 |iptorTyp|e != 'nu|
|00004df0| 6c 6c 27 29 0d 09 09 09 | 26 26 20 28 72 65 70 6c |ll')....|&& (repl|
|00004e00| 79 2d 3e 64 65 73 63 72 | 69 70 74 6f 72 54 79 70 |y->descr|iptorTyp|
|00004e10| 65 20 21 3d 20 27 6e 75 | 6c 6c 27 29 29 20 7b 09 |e != 'nu|ll')) {.|
|00004e20| 2f 2a 20 4e 6f 74 65 3a | 20 69 66 20 74 68 65 20 |/* Note:| if the |
|00004e30| 6f 74 68 65 72 20 73 69 | 64 65 20 64 69 64 6e 27 |other si|de didn'|
|00004e40| 74 20 61 73 6b 20 66 6f | 72 20 61 20 72 65 70 6c |t ask fo|r a repl|
|00004e50| 79 2c 20 74 68 69 73 20 | 63 6f 75 6c 64 20 62 65 |y, this |could be|
|00004e60| 20 61 20 6e 75 6c 6c 20 | 64 65 73 63 20 2a 2f 0d | a null |desc */.|
|00004e70| 09 09 09 65 72 72 20 3d | 20 41 45 50 75 74 50 61 |...err =| AEPutPa|
|00004e80| 72 61 6d 44 65 73 63 28 | 72 65 70 6c 79 2c 20 6b |ramDesc(|reply, k|
|00004e90| 65 79 44 69 72 65 63 74 | 4f 62 6a 65 63 74 2c 20 |eyDirect|Object, |
|00004ea0| 26 72 65 70 6c 79 44 65 | 73 63 29 3b 0d 09 09 09 |&replyDe|sc);....|
|00004eb0| 28 76 6f 69 64 29 41 45 | 44 69 73 70 6f 73 65 44 |(void)AE|DisposeD|
|00004ec0| 65 73 63 28 26 72 65 70 | 6c 79 44 65 73 63 29 3b |esc(&rep|lyDesc);|
|00004ed0| 0d 09 7d 0d 0d 09 72 65 | 74 75 72 6e 20 65 72 72 |..}...re|turn err|
|00004ee0| 3b 0d 7d 20 2f 2a 20 57 | 69 6e 5f 41 45 5f 44 69 |;.} /* W|in_AE_Di|
|00004ef0| 73 70 61 74 63 68 65 72 | 20 2a 2f 0d 0d 00 00 00 |spatcher| */.....|
|00004f00| 00 00 01 00 00 00 02 d8 | 00 00 01 d8 00 00 00 4a |........|.......J|
|00004f10| 00 00 00 00 01 00 a5 3e | c5 ec 52 4d 00 00 7d a1 |.......>|..RM..}.|
|00004f20| 7d a1 00 05 7d a2 7d a1 | 00 00 00 00 00 00 00 01 |}...}.}.|........|
|00004f30| 09 63 57 69 6e 64 6f 77 | 2e 63 02 00 00 00 54 45 |.cWindow|.c....TE|
|00004f40| 58 54 4b 41 48 4c 01 00 | 00 2e 00 c9 00 00 00 00 |XTKAHL..|........|
|00004f50| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 2e 00 c9 |..TEXTKA|HL......|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 a5 3f 33 1b 00 00 | 4e 7d 00 00 03 22 00 00 |...?3...|N}..."..|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 00 00 00 48 00 0a 43 6f | 75 72 69 65 72 00 72 69 |...H..Co|urier.ri|
|00005010| 67 68 74 20 31 39 39 31 | 2c 20 41 70 70 6c 65 20 |ght 1991|, Apple |
|00005020| 43 6f 6d 70 75 74 00 06 | 00 04 00 3c 00 24 01 fa |Comput..|...<.$..|
|00005030| 02 e2 00 3c 00 24 01 fa | 02 e2 a5 c9 8d fe 00 00 |...<.$..|........|
|00005040| 00 a7 00 00 00 a7 00 00 | 00 00 01 00 00 00 00 1e |........|........|
|00005050| 00 3c 00 24 01 fa 02 e2 | 00 3c 00 24 01 fa 02 e2 |.<.$....|.<.$....|
|00005060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005070| 01 66 00 0e 00 00 1d 61 | 00 00 1d 71 11 42 75 69 |.f.....a|...q.Bui|
|00005080| 6c 64 57 69 6e 64 6f 77 | 54 6f 6b 65 6e 00 00 00 |ldWindow|Token...|
|00005090| 11 2f 00 00 11 3b 0d 43 | 6f 75 6e 74 57 69 6e 64 |./...;.C|ountWind|
|000050a0| 6f 77 73 00 00 00 13 98 | 00 00 13 a9 11 46 69 6e |ows.....|.....Fin|
|000050b0| 64 49 6e 64 65 78 65 64 | 57 69 6e 64 6f 77 00 00 |dIndexed|Window..|
|000050c0| 12 13 00 00 12 21 0f 47 | 65 74 57 69 6e 64 6f 77 |.....!.G|etWindow|
|000050d0| 49 6e 64 65 78 00 00 00 | 09 c9 00 00 09 e3 1b 50 |Index...|.......P|
|000050e0| 72 6f 70 65 72 74 79 46 | 72 6f 6d 57 69 6e 64 6f |ropertyF|romWindo|
|000050f0| 77 41 63 63 65 73 73 6f | 72 00 00 00 02 10 00 00 |wAccesso|r.......|
|00005100| 02 26 17 57 69 6e 64 6f | 77 46 72 6f 6d 4e 75 6c |.&.Windo|wFromNul|
|00005110| 6c 41 63 63 65 73 73 6f | 72 00 00 00 46 46 00 00 |lAccesso|r...FF..|
|00005120| 46 57 11 57 69 6e 5f 41 | 45 5f 44 69 73 70 61 74 |FW.Win_A|E_Dispat|
|00005130| 63 68 65 72 00 00 28 a9 | 00 00 28 b2 09 57 69 6e |cher..(.|..(..Win|
|00005140| 5f 43 6c 6f 73 65 00 00 | 15 c0 00 00 15 d1 11 57 |_Close..|.......W|
|00005150| 69 6e 5f 43 6f 6e 76 65 | 72 74 41 62 73 4b 65 79 |in_Conve|rtAbsKey|
|00005160| 00 00 1f b1 00 00 1f c2 | 11 57 69 6e 5f 43 72 65 |........|.Win_Cre|
|00005170| 61 74 65 45 6c 65 6d 65 | 6e 74 00 00 25 f9 00 00 |ateEleme|nt..%...|
|00005180| 26 04 0b 57 69 6e 5f 47 | 65 74 44 61 74 61 00 00 |&..Win_G|etData..|
|00005190| 29 83 00 00 29 94 11 57 | 69 6e 5f 52 65 61 64 54 |)...)..W|in_ReadT|
|000051a0| 6f 6b 65 6e 44 61 74 61 | 00 00 26 af 00 00 26 ba |okenData|..&...&.|
|000051b0| 0b 57 69 6e 5f 53 65 74 | 44 61 74 61 00 00 38 cf |.Win_Set|Data..8.|
|000051c0| 00 00 38 e1 13 57 69 6e | 5f 57 72 69 74 65 54 6f |..8..Win|_WriteTo|
|000051d0| 6b 65 6e 44 61 74 61 00 | 00 00 01 00 00 00 02 d8 |kenData.|........|
|000051e0| 00 00 01 d8 00 00 00 4a | 00 5c 07 94 0b 06 00 00 |.......J|.\......|
|000051f0| 00 1c 00 4a 00 00 4d 50 | 53 52 00 02 00 0a 03 ed |...J..MP|SR......|
|00005200| ff ff 00 00 00 00 00 00 | 00 00 03 f0 ff ff 00 00 |........|........|
|00005210| 00 4c 00 00 00 00 03 ef | ff ff 00 00 00 6e 00 00 |.L......|.....n..|
|00005220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+